lib/test_dummy.rb in test_dummy-0.2.0 vs lib/test_dummy.rb in test_dummy-0.2.1
- old
+ new
@@ -205,10 +205,10 @@
def execute_dummy_operation(model, with_attributes = nil)
return model unless (@test_dummy_order)
@test_dummy_order.each do |name|
if (reflection = reflect_on_association(name))
- unless ((with_attributes and with_attributes.key?(name.to_sym)) or model.send(name))
+ unless ((with_attributes and with_attributes.key?(name.to_sym)) or model.send(name).present?)
model.send(:"#{name}=", dummy_method_call(model, with_attributes, dummy_method(name)))
end
else
unless (with_attributes and (with_attributes.key?(name.to_sym) or with_attributes.key?(name.to_s)))
model.send(:"#{name}=", dummy_method_call(model, with_attributes, dummy_method(name)))