Skip to content

Instantly share code, notes, and snippets.

@tbuehlmann
Created April 30, 2017 08:15
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 tbuehlmann/4c14c401be79559edff6b86a7f31bd38 to your computer and use it in GitHub Desktop.
Save tbuehlmann/4c14c401be79559edff6b86a7f31bd38 to your computer and use it in GitHub Desktop.
class Distance < ApplicationRecord
has_many :events # only if you need to be able to call distance.events
end
class Event < ApplicationRecord
belongs_to :style
belongs_to :distance
end
class Style < ApplicationRecord
has_many :events # only if you need to be able to call style.events
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment