Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Movie < ActiveRecord::Base
- scope :recently_reviewed, lambda { |n|
- Movie.joins(:reviews).where(['reviews.created_at >= ?', n.days.ago]).uniq
- }
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement