marcinruszkiewicz / where_chain

WhereChain - don't write Post.where('comments > ?', 5), write Post.where.gt(comments: 5) instead!
MIT License
44 stars 4 forks source link

Not compatible with rails 6.1 #18

Closed jonian closed 3 years ago

jonian commented 3 years ago

Hi @marcinruszkiewicz, thanks for this gem. I tried using this with rails 6.1 but it fails with method missing for where_clause_factory, used here.

If you are not planning to support rails 6.1, you should add < 6.1 for activerecord dependency.

I would like to help with this, but I tried and could not make it work. I will give it another try and if it works, I will make a PR.

CodeMeister commented 3 years ago

Another issue needing resolved:

when updating a record from the console, the error is:

NoMethodError (undefined method `sanitize_forbidden_attributes' for #<ActiveRecord::QueryMethods::WhereChain:0x00007fe03d85ae10>)

Removing { case_sensitive: false } allows the update to proceed.