Skip to content
Browse files

remove rails3 depreciation warnings

  • Loading branch information...
1 parent 66ed795 commit 7e0144dec39872504aa044594f4ecdef596e7af5 Maciej Kozak committed
View
4 lib/authlogic/acts_as_authentic/logged_in_status.rb
@@ -32,8 +32,8 @@ def self.included(klass)
klass.class_eval do
include InstanceMethods
- named_scope :logged_in, lambda { {:conditions => ["last_request_at > ?", logged_in_timeout.seconds.ago]} }
- named_scope :logged_out, lambda { {:conditions => ["last_request_at is NULL or last_request_at <= ?", logged_in_timeout.seconds.ago]} }
+ scope :logged_in, lambda { {:conditions => ["last_request_at > ?", logged_in_timeout.seconds.ago]} }
+ scope :logged_out, lambda { {:conditions => ["last_request_at is NULL or last_request_at <= ?", logged_in_timeout.seconds.ago]} }
end
end
View
4 lib/authlogic/acts_as_authentic/password.rb
@@ -277,7 +277,7 @@ def reset_password
# Resets the password to a random friendly token and then saves the record.
def reset_password!
reset_password
- save_without_session_maintenance(false)
+ save_without_session_maintenance(:validate => false)
end
alias_method :randomize_password!, :reset_password!
@@ -314,7 +314,7 @@ def transition_password?(index, encryptor, crypted, check_against_database)
def transition_password(attempted_password)
self.password = attempted_password
- save(false)
+ save(:validate => false)
end
def require_password?
View
2 lib/authlogic/acts_as_authentic/perishable_token.rb
@@ -91,7 +91,7 @@ def reset_perishable_token
# Same as reset_perishable_token, but then saves the record afterwards.
def reset_perishable_token!
reset_perishable_token
- save_without_session_maintenance(false)
+ save_without_session_maintenance(:validate => false)
end
# A convenience method based on the disable_perishable_token_maintenance configuration option.
View
2 lib/authlogic/acts_as_authentic/persistence_token.rb
@@ -53,7 +53,7 @@ def reset_persistence_token
# Same as reset_persistence_token, but then saves the record.
def reset_persistence_token!
reset_persistence_token
- save_without_session_maintenance(false)
+ save_without_session_maintenance(:validate => false)
end
alias_method :forget!, :reset_persistence_token!
View
2 lib/authlogic/session/callbacks.rb
@@ -92,7 +92,7 @@ def persist
def save_record(alternate_record = nil)
r = alternate_record || record
- r.save_without_session_maintenance(false) if r && r.changed? && !r.readonly?
+ r.save_without_session_maintenance(:validate => false) if r && r.changed? && !r.readonly?
end
end
end
View
6 test/libs/user_session.rb
@@ -1,4 +1,10 @@
class UserSession < Authlogic::Session::Base
+
+ # fix dla rails3
+ def to_key
+ new_record? ? nil : [ self.send(self.class.primary_key) ]
+ end
+
end
class BackOfficeUserSession < Authlogic::Session::Base

0 comments on commit 7e0144d

Please sign in to comment.
Something went wrong with that request. Please try again.