Skip to content

Commit

Permalink
After changes in support, this applies to all supported Rails versions
Browse files Browse the repository at this point in the history
  • Loading branch information
pablobm committed Apr 18, 2023
1 parent 9c16f4c commit 4b0047e
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions spec/support/field_matchers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,12 @@ def should_permit_param(expected_param, for_attribute:, on_model:)
resource_class: on_model,
)

if Rails::VERSION::MAJOR <= 6
permitted_param = if permitted_param.respond_to?(:transform_keys)
permitted_param.deep_transform_keys(&:to_s)
else
permitted_param.to_s
end
end
permitted_param =
if permitted_param.respond_to?(:transform_keys)
permitted_param.deep_transform_keys(&:to_s)
else
permitted_param.to_s
end

expect(permitted_param).to eq(expected_param)
end
Expand Down

0 comments on commit 4b0047e

Please sign in to comment.