Created
October 15, 2010 06:56
-
-
Save baileylo/627747 to your computer and use it in GitHub Desktop.
Modifying applications models so they're aware of eachother
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
| class Board < ActiveRecord::Base | |
| has_many :conversations | |
| end |
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
| class Comment < ActiveRecord::Base | |
| belongs_to :conversation | |
| belongs_to :user | |
| validates_presence_of :body | |
| end |
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
| class Conversation < ActiveRecord::Base | |
| has_many :comments | |
| belongs_to :user | |
| belongs_to :board | |
| validates_presence_of :title | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment