I have begun to use the reference function feature of sexy migrations, and I have noticed that the fixtures are actually not playing nice with this new feature. If I create a model, whose table has this line: t.reference :user the fixure will look like one: user: when it should be user_id, now, it may be possible (I don''t know, to define an object in the fixtures now, but when I run my unit tests I get an error trying to populate a ''user'' field in my database that does not exist. So, that seems to me like its not being very intelligent. ...or am I missing something? --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On Jun 4, 12:01 am, "Derek P." <de...-88kYAtoe8eYTx9n+QjaLhg@public.gmane.org> wrote:> I have begun to use the reference function feature of sexy migrations, > and I have noticed that the fixtures are actually not playing nice > with this new feature. > > If I create a model, whose table has this line: > t.reference :user > > the fixure will look like > > one: > user: >Just user: is fine, as long as that model as a belongs_to :user Fred --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
t.references (not reference) On 4 juin, 01:01, "Derek P." <de...-88kYAtoe8eYTx9n+QjaLhg@public.gmane.org> wrote:> I have begun to use the reference function feature of sexy migrations, > and I have noticed that the fixtures are actually not playing nice > with this new feature. > > If I create a model, whose table has this line: > t.reference :user > > the fixure will look like > > one: > user: > > when it should be user_id, now, it may be possible (I don''t know, to > define an object in the fixtures now, but when I run my unit tests I > get an error trying to populate a ''user'' field in my database that > does not exist. So, that seems to me like its not being very > intelligent. > > ...or am I missing something?--~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
t.reference is working for me :/ ie: I am actually getting the proper foreign key created and everything. I may not have had the belongs_to though, good call. On Jun 3, 4:05 pm, tibastral <thibaut.as...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> t.references (not reference) > > On 4 juin, 01:01, "Derek P." <de...-88kYAtoe8eYTx9n+QjaLhg@public.gmane.org> wrote: > > > I have begun to use the reference function feature of sexy migrations, > > and I have noticed that the fixtures are actually not playing nice > > with this new feature. > > > If I create a model, whose table has this line: > > t.reference :user > > > the fixure will look like > > > one: > > user: > > > when it should be user_id, now, it may be possible (I don''t know, to > > define an object in the fixtures now, but when I run my unit tests I > > get an error trying to populate a ''user'' field in my database that > > does not exist. So, that seems to me like its not being very > > intelligent. > > > ...or am I missing something?--~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---