Skip to content

Instantly share code, notes, and snippets.

@laspluviosillas
Created November 25, 2013 19:24
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 laspluviosillas/7647186 to your computer and use it in GitHub Desktop.
Save laspluviosillas/7647186 to your computer and use it in GitHub Desktop.
class Programme < AR::Base
has_many :villages
has_many :conversations, though: :villages
end
class Village < AR::Base
has_many :discussions
has_many :conversations, through: :discussions
end
class Discussion < AR::Base
belongs_to :village
has_many :conversations
end
class Conversation < AR::Base
belongs_to :discussion
has_one :change
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment