Sha256: 6c9b64ac26eb1c479df58b414be30acfccf00ab7bae86894ccbf8055c13cfc75
Contents?: true
Size: 1.07 KB
Versions: 15
Compression:
Stored size: 1.07 KB
Contents
class LogviewsController < ApplicationController layout 'empty' active_scaffold :log do |config| config = self # Ruby19 compatibility config.list.sorting = { :id => :desc } # , :created_at => :desc config.list.columns = [:created_at, :content, :id] config.list.per_page = 20 #config.theme = :black end def upd a = false session[:logentry] = 0 if session[:logentry] cached = Rails.cache.read('logs_last') s = 0 if cached s = cached.to_i else #begin s = Log.find(:last) if s s = s.id end #rescue #end Rails.cache.write('logs_last', s) end logger.info "cached/new entry #{s}" if session[:logentry] logger.info "session entry #{session[:logentry]}" if s != session[:logentry] session[:logentry] = s a = true end else session[:logentry] = s a = true end render :nothing => true unless a end def conditions_for_collection s = Logsession.find(:last) ['logsession_id = (?)', s] if s end end
Version data entries
15 entries across 15 versions & 1 rubygems