Guest User

Untitled

a guest
Feb 20th, 2018
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. # fixed code sample from section 5.3 of Rails 2.2 release notes.
  2.  
  3. class Photo < ActiveRecord::Base
  4. belongs_to :product
  5. end
  6.  
  7. class Product < ActiveRecord::Base
  8. has_many :photos
  9. end
  10.  
  11. # Get all products with copyright-free photos:
  12. Product.find(:all, :joins => :photos,
  13. :conditions => { :photos => { :copyright => false }})
Add Comment
Please, Sign In to add comment