Created
October 24, 2008 14:58
-
-
Save hardbap/19445 to your computer and use it in GitHub Desktop.
fixed code sample from section 5.3 of Rails 2.2 release notes
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 }}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment