lib/clean_model/attribute.rb in clean_model-0.0.6 vs lib/clean_model/attribute.rb in clean_model-0.0.7
- old
+ new
@@ -33,10 +33,10 @@
end
end
def assign_default(model)
default_value = @options[:default].is_a?(Proc) ? @options[:default].call : @options[:default]
- model.send("#{@name}=", default_value) if default_value && model.respond_to?("#{@name}=")
+ model.send("#{@name}=", default_value) if !default_value.nil? && model.respond_to?("#{@name}=")
end
private
def klass
\ No newline at end of file