Persist and expose via API the progress of the tables arrangement simulations #316
@ -9,10 +9,10 @@ class TablesArrangementsController < ApplicationController
|
||||
render json: TablesArrangement
|
||||
.order(valid: :desc)
|
||||
.order(discomfort: :asc)
|
||||
.select(:id, :name, :discomfort)
|
||||
.select(:id, :name, :discomfort, :status)
|
||||
.select("digest = '#{current_digest}'::uuid as valid")
|
||||
.limit(20)
|
||||
.as_json(only: %i[id name discomfort valid])
|
||||
.as_json(only: %i[id name discomfort valid status])
|
||||
end
|
||||
|
||||
def show
|
||||
|
@ -19,7 +19,8 @@ RSpec.describe 'tables_arrangements' do
|
||||
id: { type: :string, format: :uuid },
|
||||
name: { type: :string },
|
||||
discomfort: { type: :integer },
|
||||
valid: { type: :boolean }
|
||||
valid: { type: :boolean },
|
||||
status: { type: :string, enum: %w[complete in_progress] }
|
||||
}
|
||||
}
|
||||
xit
|
||||
|
Loading…
x
Reference in New Issue
Block a user