summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authormo khan <mo@mokhan.ca>2014-02-21 06:40:45 -0700
committermo khan <mo@mokhan.ca>2014-02-21 06:40:45 -0700
commitcaaba52706c1aaba8c0831256d597ec85c473dfc (patch)
tree2df4e167b44d79cfb30b6ea3f630d30e561f4ac4 /app
parent676c9df5c6da3f60fd8f1a6184810acff5d74df9 (diff)
extract query method to look up the matching status.
Diffstat (limited to 'app')
-rw-r--r--app/controllers/v1/company_licenses_controller.rb2
-rw-r--r--app/models/license_status.rb5
2 files changed, 6 insertions, 1 deletions
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