Skip to content

Instantly share code, notes, and snippets.

@yudai09
Created November 15, 2012 01:18
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 yudai09/4076020 to your computer and use it in GitHub Desktop.
Save yudai09/4076020 to your computer and use it in GitHub Desktop.
モデルのアソシエーション
class Event < ActiveRecord::Base
has_many :days_infos
has_many :participants
# has_many :users
attr_accessible :event_name, :explanation, :password, :url
end
class Participant < ActiveRecord::Base
belongs_to :event
belongs_to :user
# has_one :user
attr_accessible :create_date, :event_id, :up, :user_id
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment