Class: BenchmarkController

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

Instance Method Summary collapse

Instance Method Details

#create ⇒ Object

Write a random model



27
28
29
30
# File 'app/controllers/benchmark_controller.rb', line 27

def create
  @model.update!(name: @model.name.reverse)
  render json: @model, status: :created
end

#index ⇒ Object

Read a random model



19
20
21
22
23
24
# File 'app/controllers/benchmark_controller.rb', line 19

def index
  render json: {
    model: @model,
    files: @model.model_files
  }
end