Skip to content

Instantly share code, notes, and snippets.

@elcontrastador
Created November 1, 2015 06:23
Show Gist options
  • Save elcontrastador/9278469c9d72a3c483d0 to your computer and use it in GitHub Desktop.
Save elcontrastador/9278469c9d72a3c483d0 to your computer and use it in GitHub Desktop.
class Phone
has_many :line_assignments
has_many :lines, through: :line_assignments
class Line
has_many :line_assigments
has_many :phones, through: :line_assignments
class LineAssignment
belongs_to :phone
belongs_to :line
line_pos:integer
ph.line_assignments.where(line_pos: 1)
line.phones
ph.lines
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment