Only update slug if empty or model condition is met

This commit is contained in:
Bertocq
2018-02-04 22:41:47 +01:00
parent 198ff0cd1f
commit e0871e5dc6
4 changed files with 17 additions and 1 deletions

View File

@@ -28,5 +28,11 @@ class Budget
investments.empty?
end
private
def generate_slug?
slug.nil? || budget.drafting?
end
end
end