Skip to content

Bump to ruby 3 and bump testing internals to Rails 6.1#82

Open
riyengar8 wants to merge 1 commit intofractaledmind:masterfrom
riyengar8:ruby3
Open

Bump to ruby 3 and bump testing internals to Rails 6.1#82
riyengar8 wants to merge 1 commit intofractaledmind:masterfrom
riyengar8:ruby3

Conversation

@riyengar8
Copy link
Contributor

Hi Stephen. Hope you are well.

My main intention with this PR is to be able to use this gem with Ruby 3. The single Ruby 3 fix in here is in lib/active_set/filtering/active_record/query_value.rb, explicitly dereferencing the hash into keyword arguments.

The rest of this is to bump the testing internals to Rails 6 since Rails 5 isn't Ruby 3 compatible.

I made the changes you see in lib/active_set/filtering/active_record/operators.rb because Arel started casting decimal values after the Rails bump in the BLANK and MATCHER transformers in an unhelpful way, such that clauses like "decimal LIKE '%3.14%'" would become "decimal LIKE 0". Bypassing these matchers for the decimal type was the fastest way I could get the specs passing.


str = MATCHER_TRANSFORMER.call(sql: sql, type: type, **ctx)
next str if ['boolean'].include? type.to_s
next str if ['boolean', 'decimal'].include? type.to_s
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style/WordArray: Use %w or %W for an array of words.


str = MATCHER_TRANSFORMER.call(sql: sql, type: type, **ctx)
next str if ['boolean'].include? type.to_s
next str if ['boolean', 'decimal'].include? type.to_s
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style/WordArray: Use %w or %W for an array of words.


str = MATCHER_TRANSFORMER.call(sql: sql, type: type, **ctx)
next str if ['boolean'].include? type.to_s
next str if ['boolean', 'decimal'].include? type.to_s
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style/WordArray: Use %w or %W for an array of words.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant