From 5e7468e8a8e17bfe9fe98931250472f911294bf4 Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Thu, 12 May 2016 11:26:11 +0200 Subject: [PATCH] Improved code style. --- lib/session_helper.rb | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/session_helper.rb b/lib/session_helper.rb index f355e153c..c38f0e248 100644 --- a/lib/session_helper.rb +++ b/lib/session_helper.rb @@ -6,10 +6,10 @@ module SessionHelper # load collections to deliver from external files dir = File.expand_path('../../', __FILE__) - files = Dir.glob( "#{dir}/app/controllers/sessions/collection_*.rb" ) + files = Dir.glob( "#{dir}/app/controllers/sessions/collection_*.rb") files.each { |file| load file - (default_collection, assets ) = ExtraCollection.session( default_collection, assets, user ) + (default_collection, assets) = ExtraCollection.session(default_collection, assets, user) } [default_collection, assets] @@ -28,15 +28,15 @@ module SessionHelper def self.cleanup_expired # delete temp. sessions - ActiveRecord::SessionStore::Session.where('persistent IS NULL AND updated_at < ?', Time.zone.now - 2.hours ).delete_all + ActiveRecord::SessionStore::Session.where('persistent IS NULL AND updated_at < ?', Time.zone.now - 2.hours).delete_all # web sessions not updated the last x days - ActiveRecord::SessionStore::Session.where('updated_at < ?', Time.zone.now - 60.days ).delete_all + ActiveRecord::SessionStore::Session.where('updated_at < ?', Time.zone.now - 60.days).delete_all end def self.get(id) - ActiveRecord::SessionStore::Session.find_by( id: id ) + ActiveRecord::SessionStore::Session.find_by(id: id) end def self.list(limit = 10_000) @@ -44,7 +44,7 @@ module SessionHelper end def self.destroy(id) - session = ActiveRecord::SessionStore::Session.find_by( id: id ) + session = ActiveRecord::SessionStore::Session.find_by(id: id) return if !session session.destroy end