Skip to content

Instantly share code, notes, and snippets.

@RichardLitt
Created July 31, 2014 18:34
Show Gist options
  • Save RichardLitt/604b9748edea4a89d2e8 to your computer and use it in GitHub Desktop.
Save RichardLitt/604b9748edea4a89d2e8 to your computer and use it in GitHub Desktop.
class ParkFeature < ActiveRecord::Base
self.table_name = 'parks_features'
belongs_to :park
belongs_to :feature
end
class Feature < ActiveRecord::Base
has_many :park_features
has_many :parks, through: :park_features
end
class Park < ActiveRecord::Base
has_many :campgrounds
has_many :days
belongs_to :state
has_many :activities
has_many :features
has_many :campsites, through: :campgrounds
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment