Skip to content

Commit

Permalink
Merge branch 'release/0.6.13.3'
Browse files Browse the repository at this point in the history
  • Loading branch information
kalashnikovisme committed Apr 24, 2016
2 parents fa638e1 + 06ae198 commit dbd6155
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 12 deletions.
31 changes: 19 additions & 12 deletions app/controllers/application_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,34 @@ class ApplicationController < ActionController::Base
# For APIs, you may want to use :null_session instead.
protect_from_forgery with: :exception
before_filter :get_categories
before_filter :errors_view
before_filter :basic_auth

include Concerns::AuthManagment
include Concerns::TechinalPagesManagment
include Concerns::ActionLogger
include DatesHelper

if Rails.env.staging?
before_filter :required_basic_auth!
end

# if Rails.env.production?
rescue_from ActionView::MissingTemplate, ActiveRecord::RecordNotFound, NoMethodError do |exception|
Rails.logger.warn "ERROR MESSAGE: #{exception.message}"
Rails.logger.warn "BACKTRACE: #{exception.backtrace.first(30).join("\n")}"
render '/web/pages/shared/_server_error', status: 500
end
# end

private

def get_categories
@categories_tree = Category.get_tree
end

def basic_auth
if Rails.env.staging?
before_filter :required_basic_auth!
end
end

def errors_view
if Rails.env.production?
rescue_from ActionView::MissingTemplate, ActiveRecord::RecordNotFound, NoMethodError do |exception|
Rails.logger.warn "ERROR MESSAGE: #{exception.message}"
Rails.logger.warn "BACKTRACE: #{exception.backtrace.first(30).join("\n")}"
render '/web/pages/shared/_server_error', status: 500
end
end
end

end
1 change: 1 addition & 0 deletions app/controllers/rss/application_controller.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
class Rss::ApplicationController < ApplicationController
before_filter :set_rss_format
skip_before_filter :errors_view

private

Expand Down

0 comments on commit dbd6155

Please sign in to comment.