On Oct 20, 6:02 am, Jose Ernesto Suarez <[email protected]>
wrote:
> I´ll make a relationship between "notificaciones" and "users" as
> "origen" and "destinatarios" respectively.At the moment i´m working
> with the "origen" relationship with bad results...Rails accepts the
> Notificacion.origen = User asignement, but don´t stores nothing in the
> database.
>
> You can see..
>
> #I get the Notificacion with no origen>> n =Notificacion.last
>
> => #<Notificacion id: 1, evento_id: 1, origen: nil, correo: nil,
> created_at: "2009-10-20 07:44:53", updated_at: "2009-10-20 08:17:10">

You've got a field named wrong here; if you want Notificacion to
belongs_to User, you'll need to name the foreign key origen_id; I'd
guess that the various attribute setters are running headlong into
each other causing the behavior you've described.

--Matt Jones
--~--~---------~--~----~------------~-------~--~----~
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