Applied some rubocops.

This commit is contained in:
Martin Edenhofer 2015-05-04 21:11:20 +02:00
parent 700616f5e2
commit a969242ada
2 changed files with 8 additions and 11 deletions

View file

@ -124,7 +124,7 @@ class LongPollingController < ApplicationController
count = count - 1 count = count - 1
queue = Sessions.queue( client_id ) queue = Sessions.queue( client_id )
if queue && queue[0] if queue && queue[0]
logger.debug "send " + queue.inspect + client_id.to_s logger.debug "send #{queue.inspect} to #{client_id}"
render json: queue render json: queue
return return
end end

View file

@ -228,12 +228,8 @@ returns
end end
def cache_update(o) def cache_update(o)
if self.respond_to?('cache_delete') self.cache_delete if self.respond_to?('cache_delete')
self.cache_delete o.cache_delete if o.respond_to?('cache_delete')
end
if o.respond_to?('cache_delete')
o.cache_delete
end
end end
def cache_delete def cache_delete
@ -492,7 +488,9 @@ returns
def self.latest_change def self.latest_change
key = "#{self.new.class.name}_latest_change" key = "#{self.new.class.name}_latest_change"
updated_at = Cache.get( key ) updated_at = Cache.get( key )
puts "LOG AA #{key}/#{updated_at}"
logger.debug "request latest_change for #{key}/#{updated_at}"
# if we do not have it cached, do lookup # if we do not have it cached, do lookup
if !updated_at if !updated_at
o = self.select(:updated_at).order(updated_at: :desc).limit(1).first o = self.select(:updated_at).order(updated_at: :desc).limit(1).first
@ -500,10 +498,9 @@ puts "LOG AA #{key}/#{updated_at}"
updated_at = o.updated_at updated_at = o.updated_at
self.latest_change_set(updated_at) self.latest_change_set(updated_at)
end end
puts "LOG AA Lookup #{key}/#{updated_at}" logger.debug "lookup latest_change for #{key}/#{updated_at}"
end end
puts "LOG AA RETURN #{key}/#{updated_at}" logger.debug "return latest_change for #{key}/#{updated_at}"
updated_at updated_at
end end