Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class MaterialFeature < ActiveRecord::Base
- has_many :materials
- has_many :material_names, :through=>:materials
- end
- class MaterialName < ActiveRecord::Base
- has_many :materials
- has_many :material_features, :through=>:materials
- end
- #essa tabela Material é o resultado do relacionamento N<>N entre as tabelas MaterialFeature e MaterialName
- class Material < ActiveRecord::Base
- belongs_to :material_name
- belongs_to :material_feature
- end
Add Comment
Please, Sign In to add comment