summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authormo khan <mo@mokhan.ca>2014-02-20 20:22:06 -0700
committermo khan <mo@mokhan.ca>2014-02-20 20:22:06 -0700
commit9a094059fcb67a9f54ee73efbdecc2835a5fe0c6 (patch)
tree78efa3eaf787495a1e978168eb648e10ec3bd365 /app
parent8fa71f5e5200c91ab3916154a9b00e75c4064a2f (diff)
implement index action on company licenses controller.
Diffstat (limited to 'app')
-rw-r--r--app/controllers/v1/company_licenses_controller.rb14
-rw-r--r--app/models/company.rb2
2 files changed, 15 insertions, 1 deletions
diff --git a/app/controllers/v1/company_licenses_controller.rb b/app/controllers/v1/company_licenses_controller.rb
index aa52b26..06d2145 100644
--- a/app/controllers/v1/company_licenses_controller.rb
+++ b/app/controllers/v1/company_licenses_controller.rb
@@ -1,2 +1,14 @@
-class V1::CompanyLicensesController
+class V1::CompanyLicensesController < ApplicationController
+ before_filter :load_company
+
+ def index
+ @active_licenses = @company.active_licenses
+ render json: @active_licenses
+ end
+
+ private
+
+ def load_company
+ @company = Company.find(params[:company_id])
+ end
end
diff --git a/app/models/company.rb b/app/models/company.rb
new file mode 100644
index 0000000..bff819b
--- /dev/null
+++ b/app/models/company.rb
@@ -0,0 +1,2 @@
+class Company
+end