Guest User

Untitled

a guest
Jun 13th, 2018
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.22 KB | None | 0 0
  1. class Product < ActiveRecord::Base
  2. has_many :reviews
  3. end
  4.  
  5. class Review < ActiveRecord::Base
  6. belongs_to :product
  7. end
  8.  
  9. Product.find(:all, :include => 'reviews', :conditions => ['review.rating > ?', min_rating])
Add Comment
Please, Sign In to add comment