Sha256: c1bf12955b46e16f3604f61406a5d8c0ada1fc4ffbed95af084ae71711fb80d6

Contents?: true

Size: 885 Bytes

Versions: 2

Compression:

Stored size: 885 Bytes

Contents

class FitterHappierController < ActionController::Base
  layout nil
  
  def index
    render(:text => "FitterHappier Site Check Passed\n")
  end
  
  def site_check
    time = Time.now.to_formatted_s(:rfc822)
    render(:text => "FitterHappier Site Check Passed @ #{time}\n")
  end
  
  def site_and_database_check
    table_name = (Rails::VERSION::STRING >= '2.1.0' ? 'schema_migrations' : 'schema_info')
    query      = "SELECT max(lpad(version, 20, '0')) FROM #{table_name}"
    version    = ActiveRecord::Base.connection.select_value(query).to_i
    time       = Time.now.to_formatted_s(:rfc822)
    render(:text => "FitterHappier Site and Database Check Passed @ #{time}\nSchema Version: #{version}\n")
  end
  
  private
  
  def process_with_silence(*args)
    logger.silence do
      process_without_silence(*args)
    end
  end
 
  alias_method_chain :process, :silence
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
nulogy-fitter-happier-0.0.3 app/controllers/fitter_happier_controller.rb
nulogy-fitter-happier-0.0.2 app/controllers/fitter_happier_controller.rb