Ha i did it again sorry:

class Address < ActiveRecord::Base
    belongs_to :person #!!!!!!!!!!!!!!!
  end

Ok it's Friday I need to go away !


On Fri, Jul 10, 2009 at 5:33 PM, Rick<[email protected]> wrote:
> UGGHHHH! I feel so bad.
>
> Stupid copy and paste error! Amazing I could be  staring at something
> and not even see it.
>
> I was translating something else into Person/Color/Address from what I
> was working with "Product" and totally screwed up and put Product down
> since it was on my mind instead of Person.
>
> So sorry for the confusion! And thanks so much for your patience and
> help. I can't believe I was mentally translating Product into Person
> in my head:)
>
> I meant to have:
>
> class Address < ActiveRecord::Base
>     belongs_to :product
>  end
>
> That makes more sense now I bet:) Apologies again.
>
>
>
>
>
> On Fri, Jul 10, 2009 at 5:30 PM, Älphä
> Blüë<[email protected]> wrote:
>>
>> Using what I posted above you need to have the following:
>>
>> In your Address model you need to have a
>>
>> person_id
>> product_id
>>
>> If you want these foreign keys to be different you can do the following:
>>
>> Class Address
>>  belongs_to  :person
>>  belongs_to  :product  :foreign_key => uniquesomething_id
>> end
>>
>> Whatever foreign_key you use, needs to be setup correctly in the table
>> which belongs to the other table.
>>
>> It really comes down to whatever you want to do and that's why
>> diagraming is good because it allows you to see what you have before you
>> implement things to make sure they work well.
>> --
>> Posted via http://www.ruby-forum.com/.
>>
>> >>
>>
>
>
>
> --
> Rick R
>



-- 
Rick R

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to