On 21 oct, 03:24, Matt Jones <al2o...@gmail.com> wrote:
> On Oct 20, 6:02 am, Jose Ernesto Suarez <suarez.erne...@gmail.com>
> 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
Thanks Matt.. it´s exactly that was happened! Now it runs correctly.
--~--~---------~--~----~------------~-------~--~----~
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 rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---