Created
March 8, 2010 21:56
-
-
Save rbarazi/325809 to your computer and use it in GitHub Desktop.
[Beginning Rails 3] Listing 5-18. The has_many :through declarations in app/models/user.rb
This file contains 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
class User < ActiveRecord::Base | |
has_one :profile | |
has_many :articles, :order => 'published_at DESC, title ASC', | |
:dependent => :nullify | |
has_many :replies, :through => :articles, :source => :comments | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment