Skip to content


Subversion checkout URL

You can clone with
Download ZIP


Deprecation of save(false) for save(:validate => false) (Rails3) #161

rab opened this Issue · 36 comments
rab commented

DEPRECATION WARNING: save(false) is deprecated, please give save(:validate => false) instead. (called from save at /Users/rab/.rvm/gems/ruby-1.9.2-r28283/gems/activerecord-3.0.0.rc/lib/active_record/validations.rb:43)

Digging in the call stack, the source of the save is in
authlogic-2.1.5/lib/authlogic/session/callbacks.rb at line 95

The corrected call should replace false with :validate => false

    def save_record(alternate_record = nil)
      r = alternate_record || record
      r.save_without_session_maintenance(:validate => false) if r && r.changed? && !r.readonly?

forked and created a pull request for this fix and another in acts_as_authentic/logged_in_status.rb:35+36 named_scope => scope


Could you apply that patch? thx

The warning is nasty..


Here are all the places where false is getting passed down to save:

./authlogic/session/callbacks.rb:95: r.save_without_session_maintenance(false) if r && r.changed? && !r.readonly?

./authlogic/acts_as_authentic/password.rb:280: save_without_session_maintenance(false)

./authlogic/acts_as_authentic/password.rb:317: save(false)

./authlogic/acts_as_authentic/persistence_token.rb:56: save_without_session_maintenance(false)

./authlogic/acts_as_authentic/perishable_token.rb:94: save_without_session_maintenance(false)


wait - so what exactly should be done so we can avoid this error?

# This is deprecated

# change all "save(false)" occurences to   
save(:validate => false)

was this going to be patched up?
should I go in the gems and change all this, or just wait? :O

gtd commented


jsl commented

Please apply this patch


This is so annoying! Please pull the patch!


This pull request breaks rails 2 compability...


Then remove the depreciation warning


The deprecationwarning comes from rails itself..


Umm, so wouldn't it be better to patch the save_without_session_maintenance method itself, if that's the culprit?

I got rid of the deprecation message at the bottom of this gist:


It seems like you could do a check to see it it's rails 3 or rails two and fire off the right method according to jjbuckley's fix.


Sorry, I should've mentioned that my "fix" was purely to remove the warnings under Rails 3 - it will not work in a Rails < 3 application! But I agree with m3talsmith - just wrap that line in a check for the ActiveRecord version. and everyone should be happy.


Any plans to pull the railsware solution back into the main repo? This is certainly an annoying deprecation message, and it would be nice to keep everything in the original/primary repository.


Could we have a solution once and for all soon?












Until this is fixed in the official repository I'm using this:

gem 'authlogic', :git => 'git://', :branch => 'rails3'

And it is working like a charm


+1 pull




Can't someone in charge make this pull yet? This is getting pretty annoying.


I don't know if its worth mentioning, but I only got this message after I added the "magic" attributes to my User model. After adding the magic attrs I got both this warning and the one described in #120.

Both messages went after I moved up to Rails 3.0.7 (from 3.0.2) and set gem 'authlogic', '>=3.0.2' (was prev just gem 'authlogic').


thanks! worked for me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.