Skip to content

Commit

Permalink
Restore back rails_admin_controller?. Fixes #2268
Browse files Browse the repository at this point in the history
  • Loading branch information
mshibuya committed Sep 3, 2016
1 parent c099c22 commit ffa30e0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
4 changes: 4 additions & 0 deletions app/controllers/rails_admin/application_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,10 @@ def _audit!
instance_eval(&RailsAdmin::Config.audit_with)
end

def rails_admin_controller?
true
end

rescue_from RailsAdmin::ObjectNotFound do
flash[:error] = I18n.t('admin.flash.object_not_found', model: @model_name, id: params[:id])
params[:action] = 'index'
Expand Down
6 changes: 6 additions & 0 deletions spec/controllers/rails_admin/application_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,10 @@
expect { controller._current_user }.not_to raise_error
end
end

describe '#rails_admin_controller?' do
it 'returns true' do
expect(controller.send(:rails_admin_controller?)).to be true
end
end
end

0 comments on commit ffa30e0

Please sign in to comment.