Skip to content

Instantly share code, notes, and snippets.

@jpleau
Created March 5, 2013 01:03
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 jpleau/5087166 to your computer and use it in GitHub Desktop.
Save jpleau/5087166 to your computer and use it in GitHub Desktop.
class Materiel < ActiveRecord::Base
has_many :pieces
has_many :entree_materiels
has_many :commandes, :through => :pieces
end
class Piece < ActiveRecord::Base
has_many :commandes
belongs_to :materiel
end
class Commande < ActiveRecord::Base
belongs_to :piece
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment