lib/mongoid-paperclip.rb in glebtv-mongoid-paperclip-0.2.3 vs lib/mongoid-paperclip.rb in glebtv-mongoid-paperclip-0.2.4
- old
+ new
@@ -146,10 +146,10 @@
field :"#{field_name}_fingerprint", type: String
# convenience attr (RailsAdmin uses this naming)
attr_accessor :"delete_#{field_name}"
before_validation do
- self.send(field_name).clear if self.send(:"delete_#{field_name}").present?
+ self.send(field_name).clear if self.send(:"delete_#{field_name}").present? && self.send(:"delete_#{field_name}") && self.send(:"delete_#{field_name}") != '0'
end
end
end
end
end