app/controllers/bhf/application_controller.rb in bhf-0.8.0 vs app/controllers/bhf/application_controller.rb in bhf-0.8.2

- old
+ new

@@ -1,8 +1,8 @@ class Bhf::ApplicationController < ActionController::Base - before_filter :init_time, :check_admin_account, :setup_current_account, :load_config, :set_title, :set_areas + before_filter :init_time, :check_admin_account, :setup_current_account, :load_settings, :set_title, :set_areas helper_method :current_account layout 'bhf/application' def index @@ -48,12 +48,13 @@ elsif current_account.respond_to?(:bhf_roles) current_account.bhf_roles.collect(&:identifier) end end - def load_config - @settings = Bhf::SettingsParser::parse(get_account_roles(params[:bhf_area]), params[:bhf_area]) + def load_settings + yaml_parser = Bhf::Settings::YAMLParser.new(get_account_roles(params[:bhf_area]), params[:bhf_area]) + @settings = Bhf::Settings::Base.new(yaml_parser.settings_hash, current_account) end def set_title @app_title = Rails.application.class.to_s.split('::').first @@ -93,10 +94,13 @@ end def init_time @start_time = Time.now end - + + def find_platform(platform_name) + Bhf::Platform::Base.new(@settings.find_platform_settings(platform_name)) + end def redirect_back_or_default(default, msg) redirect_to(params[:return_to] || default, flash: msg) end