Skip to content

Instantly share code, notes, and snippets.

@jparbros
Last active December 23, 2015 00:08
Show Gist options
  • Select an option

  • Save jparbros/6551155 to your computer and use it in GitHub Desktop.

Select an option

Save jparbros/6551155 to your computer and use it in GitHub Desktop.
# == Schema Info
#
# Table name: comments
#
# id :integer
# author :string
# email :string
# comment :text
# post_id :integer
# created_at :datetime
# updated_at :datetime
#
class Comment < ActiveRecord::Base
belongs_to :post
end
# == Schema Info
#
# Table name: posts
#
# id :integer
# title :string
# content :text
# created_at :datetime
# updated_at :datetime
#
class Post < ActiveRecord::Base
has_many :comments
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment