ColumnView fixes
This commit is contained in:
@@ -3,15 +3,15 @@ module BodyTracking
|
||||
ApplicationController.class_eval do
|
||||
private
|
||||
|
||||
def find_quantity(id = params[:id])
|
||||
@quantity = Quantity.find(id)
|
||||
def find_quantity(id = :id)
|
||||
@quantity = Quantity.find(params[id])
|
||||
@project = @quantity.project
|
||||
rescue ActiveRecord::RecordNotFound
|
||||
render_404
|
||||
end
|
||||
|
||||
def find_quantity_by_quantity_id
|
||||
find_quantity(params[:quantity_id])
|
||||
find_quantity(:quantity_id)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -10,7 +10,8 @@ module BodyTracking
|
||||
has_many :units, dependent: :destroy
|
||||
|
||||
def nutrients_column_view
|
||||
self.column_views.find_or_create_by(name: 'Nutrients', domain: :diet)
|
||||
self.column_views
|
||||
.find_or_create_by(name: 'Nutrients', domain: ColumnView.domains[:diet])
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user