I just successfully converted my Rails 2.3.8 app to Rails 3.0 Release candidate 2! I will post both the apps on my github account for everyone else. I do want to clean up the deprecation warnings as best as I can before I post them though. By far the most frequent deprecation warning that shows up everywhere, i.e., the console log as well as command line window when I run tests/cucumber etc. is the following type: DEPRECATION WARNING: save(false) is deprecated, please give save(:validate => false) instead. (called from save at /home/bruparel/.rvm/gems/ruby-1.9.2-p0/gems/activerecord-3.0.0.rc2/lib/active_record/validations.rb:43) Thing is: it is all over the place. I am not even sure where to look and what to do. It seems like it has nothing to do with save and everything else. Can someone please explain? Thanks. Bharat -- 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.
> DEPRECATION WARNING: save(false) is deprecated, please give > save(:validate => false) instead. (called from save at > /home/bruparel/.rvm/gems/ruby-1.9.2-p0/gems/activerecord-3.0.0.rc2/lib/active_record/validations.rb:43)From the 2.3.8 Docs: (ActiveRecord::Base) save(perform_validation = true) Saves the model. If the model is new a record gets created in the database, otherwise the existing record gets updated. If perform_validation is true validations run. If any of them fail the action is cancelled and save returns false. If the flag is false validations are bypassed altogether. See ActiveRecord::Validations for more information. There’s a series of callbacks associated with save. If any of the before_* callbacks return false the action is cancelled and save returns false. See ActiveRecord::Callbacks for further details (ActiveRecord::Persistence) save(options) Saves the model. If the model is new a record gets created in the database, otherwise the existing record gets updated. By default, save always run validations. If any of them fail the action is cancelled and save returns false. However, if you supply :validate => false, validations are bypassed altogether. See ActiveRecord::Validations for more information. There’s a series of callbacks associated with save. If any of the before_* callbacks return false the action is cancelled and save returns false. See ActiveRecord::Callbacks for further details. --- They just made it all "hashier." If save(false) isn''t something that you''re calling in your code it is likely in plugins or gems that you''re loading. -- 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@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Parker Selbert wrote:> (ActiveRecord::Persistence) > save(options) > Saves the model. > > If the model is new a record gets created in the database, otherwise the > existing record gets updated. > By default, save always run validations. If any of them fail the action > is cancelled and save returns false. However, if you supply :validate => > false, validations are bypassed altogether. See > ActiveRecord::Validations for more information. > > There’s a series of callbacks associated with save. If any of the > before_* callbacks return false the action is cancelled and save returns > false. See ActiveRecord::Callbacks for further details.That portion was from the Rails 3 docs, forgot to add that. -- 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@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
"If save(false) isn''t something that you''re calling in your code it is likely in plugins or gems that you''re loading." --- Thank you for your time. This makes sense. However, there is not a single place in my application where I am calling save(false) and this warning is triggered all over the place WITHOUT a reference to the line of code (in the plugin/gem) that might be triggering it. I have simply commented it out in the rails 3.0 code since in my judgement, it is more trouble than worth it? What do you think? Bharat -- 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.
Rob Biedenharn
2010-Aug-30 02:47 UTC
Re: Re: Rails 3 - the most annoying deprecation warning
On Aug 29, 2010, at 8:50 PM, Bharat Ruparel wrote:> "If save(false) isn''t something that > you''re calling in your code it is likely in plugins or gems that > you''re > loading." --- > > Thank you for your time. This makes sense. However, there is not a > single place in my application where I am calling save(false) and this > warning is triggered all over the place WITHOUT a reference to the > line > of code (in the plugin/gem) that might be triggering it. > > I have simply commented it out in the rails 3.0 code since in my > judgement, it is more trouble than worth it? > > What do you think? > > BharatIf you''re using authlogic, then you might be seeing what I described in issue 161 http://github.com/binarylogic/authlogic/issues#issue/161 -Rob Rob Biedenharn Rob-xa9cJyRlE0mWcWVYNo9pwxS2lgjeYSpx@public.gmane.org http://AgileConsultingLLC.com/ rab-/VpnD74mH8+00s0LW7PaslaTQe2KTcn/@public.gmane.org http://GaslightSoftware.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.
Bharat Ruparel wrote:> Thank you for your time. This makes sense. However, there is not a > single place in my application where I am calling save(false) and this > warning is triggered all over the place WITHOUT a reference to the line > of code (in the plugin/gem) that might be triggering it. > > I have simply commented it out in the rails 3.0 code since in my > judgement, it is more trouble than worth it? > > What do you think? > > BharatThe "head in the sand" approach isn''t usually a good one, but I can understand your frustration at all of the Deprecation warnings. If you aren''t using it then it is certainly a gem or plugin, and with Rails 3 officially out they will be updated shortly. If they aren''t actively updated you should investigate another solution anyhow =) -- 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.