diff options
| author | Zog | 2018-03-07 07:50:02 +0100 |
|---|---|---|
| committer | Zog | 2018-03-12 12:00:13 +0100 |
| commit | b810deb08cadd56caeb76eb81cff363458bb79a3 (patch) | |
| tree | 6fd0c1bc383a9fa501666f6d86cee2ec06c573cd /app/controllers/api | |
| parent | 7b53b4c86d0469c21b54f4f974fbae5fc205ed0f (diff) | |
| download | chouette-core-b810deb08cadd56caeb76eb81cff363458bb79a3.tar.bz2 | |
Refs #6133; Fix specs
Diffstat (limited to 'app/controllers/api')
| -rw-r--r-- | app/controllers/api/v1/imports_controller.rb | 4 | ||||
| -rw-r--r-- | app/controllers/api/v1/internals/netex_imports_controller.rb | 8 | ||||
| -rw-r--r-- | app/controllers/api/v1/netex_imports_controller.rb | 2 |
3 files changed, 7 insertions, 7 deletions
diff --git a/app/controllers/api/v1/imports_controller.rb b/app/controllers/api/v1/imports_controller.rb index 3d7f4ca79..dc2df0697 100644 --- a/app/controllers/api/v1/imports_controller.rb +++ b/app/controllers/api/v1/imports_controller.rb @@ -1,11 +1,11 @@ class Api::V1::ImportsController < Api::V1::IbooController - defaults :resource_class => WorkbenchImport + defaults :resource_class => Import::Workbench belongs_to :workbench def create args = workbench_import_params.merge(creator: 'Webservice') @import = parent.workbench_imports.create(args) - if @import.valid? + if @import.valid? create! else render json: { status: "error", messages: @import.errors.full_messages } diff --git a/app/controllers/api/v1/internals/netex_imports_controller.rb b/app/controllers/api/v1/internals/netex_imports_controller.rb index c8e33f7b8..c2b7b20cc 100644 --- a/app/controllers/api/v1/internals/netex_imports_controller.rb +++ b/app/controllers/api/v1/internals/netex_imports_controller.rb @@ -25,13 +25,13 @@ module Api private def find_netex_import - @netex_import = NetexImport.find(params[:id]) + @netex_import = Import::Netex.find(params[:id]) rescue ActiveRecord::RecordNotFound render json: { - status: "error", + status: "error", message: "Record not found" } - finish_action! + finish_action! end def find_workbench @@ -52,7 +52,7 @@ module Api attributes = attributes.merge referential_id: @new_referential.id - @netex_import = NetexImport.new attributes + @netex_import = Import::Netex.new attributes @netex_import.save! unless @netex_import.referential diff --git a/app/controllers/api/v1/netex_imports_controller.rb b/app/controllers/api/v1/netex_imports_controller.rb index d86c1fcd8..2654fa088 100644 --- a/app/controllers/api/v1/netex_imports_controller.rb +++ b/app/controllers/api/v1/netex_imports_controller.rb @@ -34,7 +34,7 @@ module Api attributes = attributes.merge referential_id: @new_referential.id - @netex_import = NetexImport.new attributes + @netex_import = Import::Netex.new attributes @netex_import.save! unless @netex_import.referential |
