Skip to content

Instantly share code, notes, and snippets.

@Gregg
Created August 30, 2011 19:41
Show Gist options
  • Save Gregg/1181816 to your computer and use it in GitHub Desktop.
Save Gregg/1181816 to your computer and use it in GitHub Desktop.
class Tweet < ActiveRecord::Base
has_many :categorizations
has_many :categories, through: :categorizations
end
class Categorization < ActiveRecord::Base
belongs_to :tweet
belongs_to :category
end
class Category < ActiveRecord::Base
has_many :categorizations
has_many :tweets, through: :categorizations
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment