From caaba52706c1aaba8c0831256d597ec85c473dfc Mon Sep 17 00:00:00 2001 From: mo khan Date: Fri, 21 Feb 2014 06:40:45 -0700 Subject: extract query method to look up the matching status. --- app/controllers/v1/company_licenses_controller.rb | 2 +- app/models/license_status.rb | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) (limited to 'app') diff --git a/app/controllers/v1/company_licenses_controller.rb b/app/controllers/v1/company_licenses_controller.rb index 32e3bc1..234345c 100644 --- a/app/controllers/v1/company_licenses_controller.rb +++ b/app/controllers/v1/company_licenses_controller.rb @@ -9,7 +9,7 @@ class V1::CompanyLicensesController < ApplicationController private def search_filters - { status: LicenseStatus::ACTIVE, township: params[:township] } + { status: LicenseStatus.find_match(params[:status]), township: params[:township] } end def filter_using(scope, filters) diff --git a/app/models/license_status.rb b/app/models/license_status.rb index abe54b1..e22a71c 100644 --- a/app/models/license_status.rb +++ b/app/models/license_status.rb @@ -1,3 +1,8 @@ module LicenseStatus ACTIVE="active" + ALL=[ACTIVE] + + def self.find_match(status) + ACTIVE + end end -- cgit v1.2.3