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

Version Path
six-updater-web-0.13.6 lib/six-updater-web/app/controllers/logviews_controller.rb
six-updater-web-0.13.5 lib/app/controllers/logviews_controller.rb
six-updater-web-0.13.4 lib/app/controllers/logviews_controller.rb
six-updater-web-0.13.3 lib/app/controllers/logviews_controller.rb
six-updater-web-0.13.2 lib/app/controllers/logviews_controller.rb
six-updater-web-0.13.1 lib/app/controllers/logviews_controller.rb
six-updater-web-0.12.7 lib/app/controllers/logviews_controller.rb
six-updater-web-0.12.6 lib/app/controllers/logviews_controller.rb
six-updater-web-0.12.5 lib/app/controllers/logviews_controller.rb
six-updater-web-0.12.4 lib/app/controllers/logviews_controller.rb
six-updater-web-0.12.3 lib/app/controllers/logviews_controller.rb
six-updater-web-0.12.2 lib/app/controllers/logviews_controller.rb
six-updater-web-0.12.1 lib/app/controllers/logviews_controller.rb
six-updater-web-0.11.2 lib/app/controllers/logviews_controller.rb
six-updater-web-0.11.1 lib/app/controllers/logviews_controller.rb