Skip to content

Commit

Permalink
Merge branch 'release/0.6.13.4'
Browse files Browse the repository at this point in the history
  • Loading branch information
kalashnikovisme committed Apr 24, 2016
2 parents dbd6155 + 718bdd8 commit cc58355
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 20 deletions.
19 changes: 0 additions & 19 deletions app/controllers/application_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ 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
Expand All @@ -16,21 +14,4 @@ class ApplicationController < ActionController::Base
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: 0 additions & 1 deletion app/controllers/rss/application_controller.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
class Rss::ApplicationController < ApplicationController
before_filter :set_rss_format
skip_before_filter :errors_view

private

Expand Down
12 changes: 12 additions & 0 deletions app/controllers/web/application_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,18 @@ class Web::ApplicationController < ApplicationController
include Concerns::NotificationManagment
include Concerns::NotificatableItems

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

def load_categories_tree
@first_category = Category.find_by_name 'Кто мы такие'
@about_site_category = Category.find_by_name 'Сайт МИЦ'
Expand Down

0 comments on commit cc58355

Please sign in to comment.