app/models/unidom/common/concerns/model_extension.rb in unidom-common-1.3 vs app/models/unidom/common/concerns/model_extension.rb in unidom-common-1.4
- old
+ new
@@ -134,10 +134,14 @@
else
::SecureRandom.uuid
end
end
+ def assert_present!(name, value)
+ raise ArgumentError.new("The #{name} argument is required.") if value.blank?
+ end
+
end
module ClassMethods
def to_id(model)
@@ -170,9 +174,13 @@
notation['columns'] ||= {}
notation['columns'][name] = value
end
end
end
+ end
+
+ def assert_present!(name, value)
+ raise ArgumentError.new("The #{name} argument is required.") if value.blank?
end
end
end