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')
Written by Davide D'Agostino
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Ruby
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#