You need three tables to represent a many-to-many association.
class Owner < ActiveRecord::Base
class Data < ActiveRecord::Base
This is shown using the more basic has_and_belongs_to_many (HABTM)
associations. However, in some cases it’s necessary to store
additional information in the join table managing your many-to-many
association. In which case your can make the join table into model
class and use has_many :through.
Having owner1_id, owner2_id is in violation of the “First Normal Form
(1NF)” relational database rule.
On Aug 1, 12:07 am, Morgan M. [email protected]