Skip to content
Browse files

refactor guide example

  • Loading branch information...
1 parent e552fe1 commit e6b2e7fbeab495a9ce0533d3f778cca9cb268597 @vijaydev vijaydev committed
Showing with 3 additions and 3 deletions.
  1. +3 −3 railties/guides/source/security.textile
View
6 railties/guides/source/security.textile
@@ -157,9 +157,9 @@ One possibility is to set the expiry time-stamp of the cookie with the session i
<ruby>
class Session < ActiveRecord::Base
def self.sweep(time = 1.hour)
- time = time.split.inject { |count, unit|
- count.to_i.send(unit)
- } if time.is_a?(String)
+ if time.is_a?(String)
+ time = time.split.inject { |count, unit| count.to_i.send(unit) }
+ end
delete_all "updated_at < '#{time.ago.to_s(:db)}'"
end

0 comments on commit e6b2e7f

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