Skip to content

Instantly share code, notes, and snippets.

@tbuehlmann
Forked from anonymous/example.rb
Last active August 29, 2015 14:11
Show Gist options
  • Save tbuehlmann/312ea6f62915c2489c65 to your computer and use it in GitHub Desktop.
Save tbuehlmann/312ea6f62915c2489c65 to your computer and use it in GitHub Desktop.
class Challenge < AR::Base
belongs_to :category
has_many :participations
has_many :participants, through: :participations
end
class Participation < AR::Base
belogns :user
belogns :challenges
end
class User < AR::Base
has_many :participations
has_many :challenges, through: :participations
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment