>       Rate.find_or_create_by_name(
>         :provider => lambda {
>                      Provider.find_by_name(row['Provider_Name']) },
>         :name => row['Rate_Name'],
>         :preis => row['Preis']
>         )
>     end
>   end
> end
>
> But the association-key (provider_id) in the table "rates" won't be
> writen to the database! I also tried accessing directly provider_id

Why are you using lambda ?

Fred
>
>  :provider_id => lambda
> { Provider.find_by_name(row['Provider_Name']) },
>
> but didn't succeed. Any help is appreciated.
>
> Thanks,
> Harm

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