Kill trailing whitespace in ruby files
This commit is contained in:
@@ -6,14 +6,14 @@ class ApplicationController < ActionController::Base
|
||||
before_filter :set_title
|
||||
before_filter :set_started_at_session
|
||||
layout "default"
|
||||
|
||||
|
||||
rescue_from User::PrivilegeError, :with => :access_denied
|
||||
rescue_from Danbooru::Paginator::PaginationError, :with => :render_pagination_limit
|
||||
|
||||
protected
|
||||
def rescue_exception(exception)
|
||||
@exception = exception
|
||||
|
||||
|
||||
if exception.is_a?(::ActiveRecord::StatementInvalid) && exception.to_s =~ /statement timeout/
|
||||
@exception = nil
|
||||
@error_message = "The database timed out running your query."
|
||||
@@ -26,17 +26,17 @@ protected
|
||||
render :template => "static/error", :status => 500
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
def render_pagination_limit
|
||||
@error_message = "You can only view up to #{Danbooru.config.max_numbered_pages} pages. Please narrow your search terms."
|
||||
render :template => "static/error", :status => 410
|
||||
end
|
||||
|
||||
|
||||
def access_denied
|
||||
previous_url = params[:url] || request.fullpath
|
||||
|
||||
respond_to do |fmt|
|
||||
fmt.html do
|
||||
fmt.html do
|
||||
if request.get?
|
||||
redirect_to new_session_path(:url => previous_url), :notice => "Access denied"
|
||||
else
|
||||
@@ -56,18 +56,18 @@ protected
|
||||
session_loader = SessionLoader.new(session, cookies, request)
|
||||
session_loader.load
|
||||
end
|
||||
|
||||
|
||||
def reset_current_user
|
||||
CurrentUser.user = nil
|
||||
CurrentUser.ip_addr = nil
|
||||
end
|
||||
|
||||
|
||||
def set_started_at_session
|
||||
if session[:started_at].blank?
|
||||
session[:started_at] = Time.now
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
%w(member banned privileged platinum contributor janitor moderator admin).each do |level|
|
||||
define_method("#{level}_only") do
|
||||
if CurrentUser.user.__send__("is_#{level}?")
|
||||
@@ -78,7 +78,7 @@ protected
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
def set_title
|
||||
@page_title = Danbooru.config.app_name + "/#{params[:controller]}"
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user