Tyler Arrigoni
2009-Jan-09 08:07 UTC
Fixture hash not available on the console in test env?
While the generated id certainly works well for tests, it was previously easier when loading the test console and interacting with your model relationships. Is there an expectation to make the fixture hashes available on the test console? Currently running 2.2.2. -- 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?hl=en -~----------~----~----~----~------~----~------~--~---
Tyler Arrigoni wrote:> While the generated id certainly works well for tests, it was previously > easier when loading the test console and interacting with your model > relationships. Is there an expectation to make the fixture hashes > available on the test console? Currently running 2.2.2.I found the following irb script, but have not been able to get it to work. The code all seems proper, and I have been able to get my irb.rc file to load properly, but it doesn''t seem to be overloading find_from_ids properly. http://railsbros.de/2008/2/26/script-console-hack-to-load-fixtures Any ideas? -- 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?hl=en -~----------~----~----~----~------~----~------~--~---
John Barnette
2009-Feb-26 04:49 UTC
Re: Fixture hash not available on the console in test env?
Hi, On Feb 24, 2009, at 8:29 AM, Jay Bo wrote:> Tyler Arrigoni wrote: >> While the generated id certainly works well for tests, it was >> previously >> easier when loading the test console and interacting with your model >> relationships. Is there an expectation to make the fixture hashes >> available on the test console? Currently running 2.2.2.You can write this pretty easily yourself using Fixtures.identify: $ script/console >> require "active_record/fixtures" >> def fixture klass, name; klass.find Fixtures.identify(name) end >> fixture User, "bob" ~ j. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Tyler Arrigoni
2009-Feb-26 05:00 UTC
Re: Fixture hash not available on the console in test env?
John Barnette wrote:> You can write this pretty easily yourself using Fixtures.identify: > > $ script/console > > >> require "active_record/fixtures" > >> def fixture klass, name; klass.find Fixtures.identify(name) end > >> fixture User, "bob" > > > ~ j.Indeed. Nice. -- 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?hl=en -~----------~----~----~----~------~----~------~--~---