I''m having an issue where the auto generated IDs in the fixtures are inconsistent from my machine to that of the other developers working on the project. The main difference between between the machines is that I''m running Snow Leopard and I think everyone else is on Leopard. We''re using factories to generate the fixtures so I don''t know what label Rails is hashing to auto generate the ID. Any help in debugging this would be greatly appreciated. Thanks in advance. -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Why are you relying on the IDs from factories? You should be using the returned objects to get the records and having the factories automatically set up associations. If you mean Seed data (from seed.rb) then the IDs should be assigned from your database. A bit confused as to what you''re trying to do with them... Cheers, Andy -- Andy Jeffries http://andyjeffries.co.uk/ #rubyonrails #mysql #jquery Registered address: 64 Sish Lane, Stevenage, Herts, SG1 3LS Company number: 5452840 On 26 February 2010 17:17, blim8183 <blim8183-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I''m having an issue where the auto generated IDs in the fixtures are > inconsistent from my machine to that of the other developers working > on the project. The main difference between between the machines is > that I''m running Snow Leopard and I think everyone else is on > Leopard. > > We''re using factories to generate the fixtures so I don''t know what > label Rails is hashing to auto generate the ID. > > Any help in debugging this would be greatly appreciated. Thanks in > advance. > > -- > 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org<rubyonrails-talk%2Bunsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> > . > 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Sorry, I just got my hands on this code for the first time a few days ago so I''m just learning it. To give you an example: The yml for the BlogPost factory contains a hardcoded author_id. That author_id is one that is apparently being auto generated by the Author factory and for the original team that''s consistently working. Unfortunately, for myself, the ids being auto generated for the Author objects don''t include the id hardcoded into the BlogPost factotry. On Feb 26, 11:43 am, Andy Jeffries <andyjeffr...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Why are you relying on the IDs from factories? > > You should be using the returned objects to get the records and having the > factories automatically set up associations. > > If you mean Seed data (from seed.rb) then the IDs should be assigned from > your database. > > A bit confused as to what you''re trying to do with them... > > Cheers, > > Andy > > -- > Andy Jeffrieshttp://andyjeffries.co.uk/ #rubyonrails #mysql #jquery > Registered address: 64 Sish Lane, Stevenage, Herts, SG1 3LS > Company number: 5452840 > > On 26 February 2010 17:17, blim8183 <blim8...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > I''m having an issue where the auto generated IDs in the fixtures are > > inconsistent from my machine to that of the other developers working > > on the project. The main difference between between the machines is > > that I''m running Snow Leopard and I think everyone else is on > > Leopard. > > > We''re using factories to generate the fixtures so I don''t know what > > label Rails is hashing to auto generate the ID. > > > Any help in debugging this would be greatly appreciated. Thanks in > > advance. > > > -- > > 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > > To unsubscribe from this group, send email to > > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org<rubyonrails-talk%2Bunsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> > > . > > 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@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.
On Feb 26, 4:17 pm, blim8183 <blim8...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I''m having an issue where the auto generated IDs in the fixtures are > inconsistent from my machine to that of the other developers working > on the project. The main difference between between the machines is > that I''m running Snow Leopard and I think everyone else is on > Leopard. > > We''re using factories to generate the fixtures so I don''t know what > label Rails is hashing to auto generate the ID. > > Any help in debugging this would be greatly appreciated. Thanks in > advance.In previous versions of rails the autogenerated fixture is (basically) just the hash of the label (as in "foo".hash). The hash method is not guaranteed to be the same across different versions or builds of ruby, in particular 64 bit versions are different to 32bit (and in snow leopard ruby is a 64 bit app). Later versions of rails (don''t remember the first) use a crc32, so that should be stable across different builds of ruby I''m not sure why you care though 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@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.
On Feb 26, 12:23 pm, Frederick Cheung <frederick.che...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> On Feb 26, 4:17 pm, blim8183 <blim8...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > I''m having an issue where the auto generated IDs in the fixtures are > > inconsistent from my machine to that of the other developers working > > on the project. The main difference between between the machines is > > that I''m running Snow Leopard and I think everyone else is on > > Leopard. > > > We''re using factories to generate the fixtures so I don''t know what > > label Rails is hashing to auto generate the ID. > > > Any help in debugging this would be greatly appreciated. Thanks in > > advance. > > In previous versions of rails the autogenerated fixture is (basically) > just the hash of the label (as in "foo".hash). > The hash method is not guaranteed to be the same across different > versions or builds of ruby, in particular 64 bit versions are > different to 32bit (and in snow leopard ruby is a 64 bit app). Later > versions of rails (don''t remember the first) use a crc32, so that > should be stable across different builds of ruby > > I''m not sure why you care thoughExactly - the whole point of the auto-generated ids is to do things like this in the fixture: author: somebody Which references the *name* of the desired author fixture rather than the id. --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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@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.
I realize that, unfortunately I didn''t write the tests and fixtures. I was just hoping there was a way I could get them to pass before I go through and change them. On Feb 27, 1:32 pm, Matt Jones <al2o...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> On Feb 26, 12:23 pm, Frederick Cheung <frederick.che...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > wrote: > > > > > On Feb 26, 4:17 pm, blim8183 <blim8...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > I''m having an issue where the auto generated IDs in the fixtures are > > > inconsistent from my machine to that of the other developers working > > > on the project. The main difference between between the machines is > > > that I''m running Snow Leopard and I think everyone else is on > > > Leopard. > > > > We''re using factories to generate the fixtures so I don''t know what > > > label Rails is hashing to auto generate the ID. > > > > Any help in debugging this would be greatly appreciated. Thanks in > > > advance. > > > In previous versions of rails the autogenerated fixture is (basically) > > just the hash of the label (as in "foo".hash). > > The hash method is not guaranteed to be the same across different > > versions or builds of ruby, in particular 64 bit versions are > > different to 32bit (and in snow leopard ruby is a 64 bit app). Later > > versions of rails (don''t remember the first) use a crc32, so that > > should be stable across different builds of ruby > > > I''m not sure why you care though > > Exactly - the whole point of the auto-generated ids is to do things > like this in the fixture: > > author: somebody > > Which references the *name* of the desired author fixture rather than > the id. > > --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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@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.