From 4f6de445141fc5542f61a1830c29ad61ecbeb49b Mon Sep 17 00:00:00 2001 From: mo khan Date: Fri, 21 Feb 2014 21:03:56 -0700 Subject: load well statuses and well types in application controller. --- app/controllers/application_controller.rb | 8 +++++++- app/controllers/v1/company_licenses_controller.rb | 6 ------ 2 files changed, 7 insertions(+), 7 deletions(-) (limited to 'app') diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index d83690e..658a065 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -1,5 +1,11 @@ class ApplicationController < ActionController::Base # Prevent CSRF attacks by raising an exception. # For APIs, you may want to use :null_session instead. - protect_from_forgery with: :exception + protect_from_forgery with: :null_session + before_filter :load_additional_payload_data + + def load_additional_payload_data + @license_statuses = LicenseStatus::ALL + @well_types = WellType::ALL + end end diff --git a/app/controllers/v1/company_licenses_controller.rb b/app/controllers/v1/company_licenses_controller.rb index df0c4ec..234345c 100644 --- a/app/controllers/v1/company_licenses_controller.rb +++ b/app/controllers/v1/company_licenses_controller.rb @@ -1,6 +1,5 @@ class V1::CompanyLicensesController < ApplicationController before_filter :load_company - before_filter :load_additional_payload_data def index @active_licenses = filter_using(@company, search_filters) @@ -22,9 +21,4 @@ class V1::CompanyLicensesController < ApplicationController def load_company @company = Company.find(params[:company_id]) end - - def load_additional_payload_data - @license_statuses = LicenseStatus::ALL - @well_types = WellType::ALL - end end -- cgit v1.2.3