1
0

Updated comments, added before_destroy where applicable

This commit is contained in:
cryptogopher
2019-12-03 00:30:30 +01:00
parent 8d368d6aa5
commit f769fff930
9 changed files with 26 additions and 5 deletions

View File

@@ -43,7 +43,6 @@ class IngredientsController < ApplicationController
end
def destroy
# FIXME: don't destroy if any meal depend on ingredient
if @ingredient.destroy
flash[:notice] = 'Deleted ingredient'
end

View File

@@ -39,7 +39,6 @@ class MeasurementsController < ApplicationController
end
def destroy
# FIXME: don't destroy if there are any readout values
if @measurement.destroy
flash[:notice] = 'Deleted measurement'
end

View File

@@ -22,7 +22,6 @@ class SourcesController < ApplicationController
end
def destroy
# FIXME: do not destroy if anything depends on it
if @source.destroy
flash[:notice] = 'Deleted source'
end

View File

@@ -22,7 +22,6 @@ class UnitsController < ApplicationController
end
def destroy
# FIXME: do not destroy if anything depends on it
if @unit.destroy
flash[:notice] = 'Deleted unit'
end