Hi all, Can anyone tell me why when I do an Organization.new in the console all string objects are nil whereas when I do an Organization.new in my unit test all the strings are '''' which is a string of length 2? Needless to say this is royally screwing up my validations. Thanks, Brent -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Check that your test database is in sync with the development one. rake db:test:prepare -Jonathan. On 10/14/06, Brent Beardsley <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > > Hi all, > > Can anyone tell me why when I do an Organization.new in the console all > string objects are nil whereas when I do an Organization.new in my unit > test all the strings are '''' which is a string of length 2? > > Needless to say this is royally screwing up my validations. > > Thanks, > > Brent > > -- > Posted via http://www.ruby-forum.com/. > > > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Hi Jonathan, Thanks for the tip. I tried your suggestion and still had the problem. After much head scratching, etc I discovered that Sqlite 3.3.8 on Windows is not playing nice with Rails. I went back to Sqlite 3.3.6 and it worked fine. So for some reason, Sqlite 3.3.8/Rails is setting default values for *EVERY* field and the string default values are incorrectly set as '''' (two single quotes - string length 2). I guess that''s why we have unit tests! Thanks again, Brent Jonathan Viney wrote:> Check that your test database is in sync with the development one. > > rake db:test:prepare > > -Jonathan.-- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---