Last Updated: September 09, 2019
·
761
· daddye

Use :symbol.gt in ActiveRecord

Put in a initializer:

Symbol.send :include, Arel::Predications

Then you can use things like:

User.where :created_at.gt(10.days.ago)
User.where :created_at.gt(10.days.ago).and(:age.gt 18)
User.where :first_name.matches('%ddYE')