Skip to content

Commit

Permalink
Normalize the last_request_at_threshold so that you can pass an integ…
Browse files Browse the repository at this point in the history
…er or a date/time range.
  • Loading branch information
binarylogic committed Dec 19, 2008
1 parent dc03026 commit 79938e1
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.rdoc
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
== 1.3.8 released 2008-11-30

* Only change persistence token if the password is not blank
* Normalize the last_request_at_threshold so that you can pass an integer or a date/time range.

== 1.3.7 released 2008-11-30

* Added session generator: script/generate session UserSession
Expand Down
2 changes: 1 addition & 1 deletion Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ begin
p.project = 'authlogic'
p.summary = "A clean, simple, and unobtrusive ruby authentication solution."
p.url = "http://github.com/binarylogic/authlogic"
p.dependencies = %w(activesupport)
p.dependencies = %w(activesupport echoe)
end
rescue LoadError => boom
puts "You are missing a dependency required for meta-operations on this gem."
Expand Down
2 changes: 1 addition & 1 deletion lib/authlogic/session/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ def find_record
if send("valid_#{find_method}?")
self.new_session = false

if record.class.column_names.include?("last_request_at") && (record.last_request_at.blank? || last_request_at_threshold.ago >= record.last_request_at)
if record.class.column_names.include?("last_request_at") && (record.last_request_at.blank? || last_request_at_threshold.to_i.seconds.ago >= record.last_request_at)
record.last_request_at = Time.now
record.save_without_session_maintenance(false)
end
Expand Down

0 comments on commit 79938e1

Please sign in to comment.