Skip to content

Commit

Permalink
Remove redundant checks
Browse files Browse the repository at this point in the history
We only support Rails versions higher than this.
  • Loading branch information
deivid-rodriguez committed Mar 7, 2022
1 parent 9b683d6 commit ffa7bb7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/ransack/helpers/form_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ def html_options(args)
private

def parameters_hash(params)
if ::ActiveRecord::VERSION::MAJOR >= 5 && params.respond_to?(:to_unsafe_h)
if params.respond_to?(:to_unsafe_h)
params.to_unsafe_h
else
params
Expand Down
3 changes: 1 addition & 2 deletions spec/ransack/helpers/form_helper_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -469,8 +469,7 @@ module Helpers
it { should match /exist\=existing/ }
end

context 'using a real ActionController::Parameter object',
if: ::ActiveRecord::VERSION::MAJOR > 3 do
context 'using a real ActionController::Parameter object' do

describe 'with symbol q:, #sort_link should include search params' do
subject { @controller.view_context.sort_link(Person.ransack, :name) }
Expand Down

0 comments on commit ffa7bb7

Please sign in to comment.