summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
Diffstat (limited to 'app')
-rw-r--r--app/controllers/application_controller.rb1
-rw-r--r--app/controllers/v1/licenses_controller.rb2
-rw-r--r--app/models/location.rb2
-rw-r--r--app/views/v1/company_licenses/index.json.jbuilder (renamed from app/views/v1/company_licenses/index.jbuilder)0
-rw-r--r--app/views/v1/licenses/_license.json.jbuilder2
5 files changed, 2 insertions, 5 deletions
diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb
index 1b2f9f7..424262c 100644
--- a/app/controllers/application_controller.rb
+++ b/app/controllers/application_controller.rb
@@ -5,7 +5,6 @@ class ApplicationController < ActionController::Base
before_filter :load_additional_payload_data
rescue_from StandardError, with: :return_server_error
-
def load_additional_payload_data
@license_statuses = LicenseStatus::ALL
@well_types = WellType::ALL
diff --git a/app/controllers/v1/licenses_controller.rb b/app/controllers/v1/licenses_controller.rb
index c62c78b..8966100 100644
--- a/app/controllers/v1/licenses_controller.rb
+++ b/app/controllers/v1/licenses_controller.rb
@@ -5,12 +5,10 @@ class V1::LicensesController < ApplicationController
def index
@licenses = License.most_recent(page: @page, per_page: @per_page)
- render json: @licenses
end
def show
@license = License.find(params[:id])
- render json: @license
end
private
diff --git a/app/models/location.rb b/app/models/location.rb
index bf7b7ef..b74eabc 100644
--- a/app/models/location.rb
+++ b/app/models/location.rb
@@ -1,3 +1,3 @@
class Location < ActiveRecord::Base
- belongs_to :license
+ belongs_to :license, autosave: true
end
diff --git a/app/views/v1/company_licenses/index.jbuilder b/app/views/v1/company_licenses/index.json.jbuilder
index 8228f3e..8228f3e 100644
--- a/app/views/v1/company_licenses/index.jbuilder
+++ b/app/views/v1/company_licenses/index.json.jbuilder
diff --git a/app/views/v1/licenses/_license.json.jbuilder b/app/views/v1/licenses/_license.json.jbuilder
index c66fb3f..b62f91b 100644
--- a/app/views/v1/licenses/_license.json.jbuilder
+++ b/app/views/v1/licenses/_license.json.jbuilder
@@ -1,6 +1,6 @@
json.id license.id
json.status license.status.to_s
-json.partial! 'v1/licenses/location', location: license.location
+#json.partial! 'v1/licenses/location', location: license.location
if license.confidential?
json.partial! 'v1/licenses/confidential_well_type', well_type: license.well_type
json.partial! 'v1/licenses/confidential_company'