hi Guys I''m doing changes to a model, and testing the changes interactively in the console. After saving a change to the model I use ''reload!'' in the console. It seems that the objects that I were working with still exist in the console, but in some weird state and I cant really work with them. So I have to reinstantiate the objects again with a Object.find... This is a pain - is there a better way to do this? Thanks! Pieter -- 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-/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.
On Sep 15, 3:08 pm, Pieter Hugo <li...-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> hi Guys > > I''m doing changes to a model, and testing the changes interactively in > the console. After saving a change to the model I use ''reload!'' in the > console. It seems that the objects that I were working with still exist > in the console, but in some weird state and I cant really work with > them. So I have to reinstantiate the objects again with a Object.find... >None that I know of. Reloading basically discards the existing classes and loads a fresh copies. Existing objects are however still instances of those zombied classes. Fred> This is a pain - is there a better way to do this? > > Thanks! > > Pieter > -- > Posted viahttp://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-/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.
Pieter Hugo wrote:> hi Guys > > I''m doing changes to a model, and testing the changes interactively in > the console. After saving a change to the model I use ''reload!'' in the > console. It seems that the objects that I were working with still exist > in the console, but in some weird state and I cant really work with > them. So I have to reinstantiate the objects again with a Object.find... > > This is a pain - is there a better way to do this?Yes. Don''t rely so much on interactive testing; use RSpec and Autotest instead.> > Thanks! > > PieterBest, -- Marnen Laibow-Koser http://www.marnen.org marnen-sbuyVjPbboAdnm+yROfE0A@public.gmane.org -- 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-/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.
Marnen Laibow-Koser wrote:> Pieter Hugo wrote: >> hi Guys >> >> I''m doing changes to a model, and testing the changes interactively in >> the console. After saving a change to the model I use ''reload!'' in the >> console. It seems that the objects that I were working with still exist >> in the console, but in some weird state and I cant really work with >> them. So I have to reinstantiate the objects again with a Object.find... >> >> This is a pain - is there a better way to do this? > > Yes. Don''t rely so much on interactive testing; use RSpec and Autotest > instead.Thanks for the comments guys. I know I need to get into proper testing. My usage case is really while I am busy writing the model. Would be great if reload! also reloaded the objects I have created in the session. Lemme look into Autotest.... Cheers from South Africa! -- 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-/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.