Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # fixed code sample from section 5.3 of Rails 2.2 release notes.
- class Photo < ActiveRecord::Base
- belongs_to :product
- end
- class Product < ActiveRecord::Base
- has_many :photos
- end
- # Get all products with copyright-free photos:
- Product.find(:all, :joins => :photos,
- :conditions => { :photos => { :copyright => false }})
Add Comment
Please, Sign In to add comment