summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
Diffstat (limited to 'app')
-rw-r--r--app/controllers/v1/company_licenses_controller.rb3
-rw-r--r--app/models/license_status.rb3
2 files changed, 5 insertions, 1 deletions
diff --git a/app/controllers/v1/company_licenses_controller.rb b/app/controllers/v1/company_licenses_controller.rb
index 06d2145..963423a 100644
--- a/app/controllers/v1/company_licenses_controller.rb
+++ b/app/controllers/v1/company_licenses_controller.rb
@@ -2,7 +2,8 @@ class V1::CompanyLicensesController < ApplicationController
before_filter :load_company
def index
- @active_licenses = @company.active_licenses
+ @active_licenses = @company.status(LicenseStatus::ACTIVE)
+ @active_licenses = @active_licenses.township(params[:township]) if params[:township].present?
render json: @active_licenses
end
diff --git a/app/models/license_status.rb b/app/models/license_status.rb
new file mode 100644
index 0000000..abe54b1
--- /dev/null
+++ b/app/models/license_status.rb
@@ -0,0 +1,3 @@
+module LicenseStatus
+ ACTIVE="active"
+end