Hey Guys,
i am searching for a solution of my little problem - maybe you wanna help ^^
I have in Ruby on Rails modeled to classes "Person" and "Contact". A Person can have many contacts and a Contact can have one specific person and describes this relation with a value
class Person < ActiveRecord::Base
has_many :contacts
end
class Contact < ActiveRecord::Base
belongs_to :person
has_one :person #how to rename this?
end
In the table of the Person is nothing special, or related column to contact, but the contact table-script looks like this
class CreateContacts < ActiveRecord::Migration
def self.up
create_table :contacts do |t|
t.references :person
t.references :person #how to rename this eather?
t.integer :value
end
end
def self.down
drop_table :contacts
end
end
as i written in the source code - i dont know how to rename the second relation to person - if you can give me a hint i would be very appreciated =)
greetings Klaf