Toggling quantity primariness from nutrients view
This commit is contained in:
16
lib/body_tracking/application_controller_patch.rb
Normal file
16
lib/body_tracking/application_controller_patch.rb
Normal file
@@ -0,0 +1,16 @@
|
||||
module BodyTracking
|
||||
module ApplicationControllerPatch
|
||||
ApplicationController.class_eval do
|
||||
private
|
||||
|
||||
# :find_* methods are called before :authorize,
|
||||
# @project is required for :authorize to succeed
|
||||
def find_quantity
|
||||
@quantity = Quantity.find(params[:id])
|
||||
@project = @quantity.project
|
||||
rescue ActiveRecord::RecordNotFound
|
||||
render_404
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user