Skip to content

Commit

Permalink
Removed store_current_location! related code completely.
Browse files Browse the repository at this point in the history
Not a needed feature and it removes overhead.
parndt committed Nov 26, 2012
1 parent a06bdaa commit 6ec5141
Showing 4 changed files with 3 additions and 27 deletions.
12 changes: 2 additions & 10 deletions core/app/helpers/refinery/site_bar_helper.rb
Original file line number Diff line number Diff line change
@@ -4,17 +4,9 @@ module SiteBarHelper
# Generates the link to determine where the site bar switch button returns to.
def site_bar_switch_link
link_to_if(admin?, t('.switch_to_your_website', site_bar_translate_locale_args),
(if session.keys.map(&:to_sym).include?(:website_return_to) and session[:website_return_to].present?
session[:website_return_to]
else
refinery.root_path(site_bar_translate_locale_args)
end)) do
refinery.root_path(site_bar_translate_locale_args)) do
link_to t('.switch_to_your_website_editor', site_bar_translate_locale_args),
(if session.keys.map(&:to_sym).include?(:refinery_return_to) and session[:refinery_return_to].present?
session[:refinery_return_to]
else
refinery.admin_root_path
end rescue refinery.admin_root_path)
refinery.admin_root_path
end
end

12 changes: 0 additions & 12 deletions core/lib/refinery/application_controller.rb
Original file line number Diff line number Diff line change
@@ -19,9 +19,6 @@ module ApplicationController

send :before_filter, :force_ssl?, :if => :admin?

send :after_filter, :store_current_location!,
:if => Proc.new {|c| send(:refinery_user?) }

if Refinery::Core.rescue_not_found
send :rescue_from, ActiveRecord::RecordNotFound,
::AbstractController::ActionNotFound,
@@ -87,14 +84,5 @@ def refinery_user_required?
redirect_to refinery.signup_path
end
end

private

def store_current_location!
if admin? && request.get? && !request.xhr? && !from_dialog?
# ensure that we don't redirect to AJAX or POST/PUT/DELETE urls
session[:refinery_return_to] = request.path.sub('//', '/')
end
end
end
end
4 changes: 0 additions & 4 deletions images/app/controllers/refinery/admin/images_controller.rb
Original file line number Diff line number Diff line change
@@ -139,10 +139,6 @@ def restrict_controller
super unless action_name == 'insert'
end

def store_current_location!
super unless action_name == 'insert' or from_dialog?
end

end
end
end
Original file line number Diff line number Diff line change
@@ -34,10 +34,10 @@ def mock_user(roles)

before do
controller.should_receive(:refinery_user_required?).and_return false
controller.should_receive(:refinery_user?).and_return true
controller.should_receive(:authenticate_refinery_user!).and_return true
controller.should_receive(:restrict_plugins).and_return true
controller.should_receive(:allow_controller?).and_return controller_permission
controller.stub(:refinery_user?).and_return true
controller.stub(:current_refinery_user).and_return logged_in_user
end
end

0 comments on commit 6ec5141

Please sign in to comment.