1
0

Added setting Formula unit in form and when loading defaults

This commit is contained in:
cryptogopher
2020-03-25 21:40:24 +01:00
parent 031b857925
commit 2efdc08931
8 changed files with 49 additions and 39 deletions

View File

@@ -4,7 +4,7 @@ class Formula < ActiveRecord::Base
attr_reader :parts, :quantities
belongs_to :quantity, inverse_of: :formula, required: true
belongs_to :unit, required: true
belongs_to :unit
validates :code, presence: true
validate do