1
0
This repository has been archived on 2023-12-07. You can view files and clone it, but cannot push or open issues or pull requests.
body_tracking/lib/body_tracking/application_controller_patch.rb
2019-11-01 21:43:56 +01:00

17 lines
417 B
Ruby

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