Skip to content

Instantly share code, notes, and snippets.

@abscondment
Created September 14, 2010 03:55
Show Gist options
  • Save abscondment/578503 to your computer and use it in GitHub Desktop.
Save abscondment/578503 to your computer and use it in GitHub Desktop.
class Restaurant < ActiveRecord::Base
has_many :restaurant_cuisines, :dependent => :delete_all
has_many :cuisines, :through => :restaurant_cuisines
end
class Cuisine < ActiveRecord::Base
has_many :restaurant_cuisines, :dependent => :delete_all
has_many :restaurants, :through => :restaurant_cuisines
end
class RestaurantCuisine < ActiveRecord::Base
belongs_to :restaurant
belongs_to :cuisine
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment