Class: ActsAsCalculator::ImportsController

Inherits:
ApplicationController show all
Defined in:
app/controllers/acts_as_calculator/imports_controller.rb

Overview

docs/PLAN.md lists JSON import and the API as two authoring paths, not two import mechanisms: this is ImportDefinitions handed the parsed request body, so an HTTP import means exactly what the generator and the rake task mean, idempotency and lookup-table guard included.

Instance Method Summary collapse

Instance Method Details

#createObject



9
10
11
12
13
14
# File 'app/controllers/acts_as_calculator/imports_controller.rb', line 9

def create
  summary = ImportDefinitions.(data: definitions)

  render json: SerializeImportSummary.(summary:),
         status: summary.success? ? :ok : :unprocessable_entity
end