Skip to content

Instantly share code, notes, and snippets.

@mnordin
Created June 13, 2013 11:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mnordin/3bd6b70e1fbb8fb874a7 to your computer and use it in GitHub Desktop.
Save mnordin/3bd6b70e1fbb8fb874a7 to your computer and use it in GitHub Desktop.
class Comment < ActiveRecord::Base
attr_accessible :body
belongs_to :post, inverse_of: :comments
end
class Post < ActiveRecord::Base
attr_accessible :body, :title
has_many :comments, inverse_of: :post
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment