1
0

compute_quantities now returns single hash

Fixed MeasurementsController view management
This commit is contained in:
cryptogopher
2020-04-26 20:21:17 +02:00
parent 9f5f31ca42
commit 4230d72206
27 changed files with 118 additions and 108 deletions

View File

@@ -24,15 +24,9 @@ module Concerns::Finders
def find_measurement
@measurement = Measurement.find(params[:id])
@routine = @measurement.routine
@project = @routine.project
rescue ActiveRecord::RecordNotFound
render_404
end
def find_measurement_routine
@routine = MeasurementRoutine.find(params[:id])
@project = @routine.project
# DON'T set @routine here: @routine is a context for :readouts view (set
# elsewhere), not a # @measurement.routine
@project = @measurement.routine.project
rescue ActiveRecord::RecordNotFound
render_404
end
@@ -44,6 +38,10 @@ module Concerns::Finders
render_404
end
def find_measurement_routine_by_measurement_routine_id
find_measurement_routine(params[:measurement_routine_id])
end
def find_quantity(id = params[:id])
@quantity = Quantity.find(id)
@project = @quantity.project