On 22 February 2011 18:34, James Byrne <[email protected]> wrote:
> James Byrne wrote in post #983156:
>> When I do this I obtain nil:
>>
>> current_shipment = current_entry.shipment
>>
> .  .  .
>>
>> Clearly I am missing something or other in the association method call
>> but I cannot seem to find what that something is.
>>
>> Does anyone here see what I am doing wrong?
>
> What I did was to change the association call named #shipment to:
>
> current_shipment = current_entry.ca_customs_shipment
>
> and things worked.  So, now my question is: what is wrong with this
> code?
>
> # #shipment returns nil always
>  belongs_to  :shipment, :class_name => 'CaCustomsShipment'

Perhaps you need :foreign_key here also.

Colin

>
> # returns ca_customs_shipment
>  belongs_to  :ca_customs_shipment
>
> --
> Posted via http://www.ruby-forum.com/.
>
> --
> 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.
>
>

-- 
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