Skip to content

Instantly share code, notes, and snippets.

@lessless
Created October 9, 2012 16:31
Show Gist options
  • Save lessless/3859901 to your computer and use it in GitHub Desktop.
Save lessless/3859901 to your computer and use it in GitHub Desktop.
class Place < ActiveRecord::Base
attr_accessible :address, :city, :name, :description
has_many :meetings
end
Class Meeting < ActiveRecord::Base
attr_accessible :start_at, :place_id, :title, :end_at
belongs_to :place
has_many :participations
has_many :players, :through => :participations
end
class Participation < ActiveRecord::Base
attr_accessible :meeting_id, :player_id
end
class Player < ActiveRecord::Base
attr_accessible :id, :city, :first_name, :gear, :last_name, :email,
:password, :password_confirmation
has_many :participations
has_many :meetings, :through => :participations
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment