diff options
author | Vijay Dev <vijaydev.cse@gmail.com> | 2011-10-13 02:17:01 +0530 |
---|---|---|
committer | Vijay Dev <vijaydev.cse@gmail.com> | 2011-10-13 02:17:01 +0530 |
commit | e6b2e7fbeab495a9ce0533d3f778cca9cb268597 (patch) | |
tree | 6b4cab5078563e1f9e7f9d8c017f9c9260db0c31 /railties/guides | |
parent | e552fe16d43d89c37b85cf3d5e8c8e5afe150529 (diff) | |
download | rails-e6b2e7fbeab495a9ce0533d3f778cca9cb268597.tar.gz rails-e6b2e7fbeab495a9ce0533d3f778cca9cb268597.tar.bz2 rails-e6b2e7fbeab495a9ce0533d3f778cca9cb268597.zip |
refactor guide example
Diffstat (limited to 'railties/guides')
-rw-r--r-- | railties/guides/source/security.textile | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/railties/guides/source/security.textile b/railties/guides/source/security.textile index 0f100e0adf..8837e06de5 100644 --- a/railties/guides/source/security.textile +++ b/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 |