lib/mongoid-paperclip.rb in glebtv-mongoid-paperclip-0.2.0 vs lib/mongoid-paperclip.rb in glebtv-mongoid-paperclip-0.2.1

- old
+ new

@@ -106,14 +106,14 @@ # Invoke Paperclip's #has_attached_file method and passes in the # arguments specified by the user that invoked Mongoid::Paperclip#has_mongoid_attached_file has_attached_file(field_name, options) # Define the necessary collection fields in Mongoid for Paperclip - field :"#{field_name}_file_name", type: String, default: nil - field :"#{field_name}_content_type", type: String, default: nil - field :"#{field_name}_file_size", type: Integer, default: nil - field :"#{field_name}_updated_at", type: Time, default: nil - field :"#{field_name}_fingerprint", type: String, default: nil + field :"#{field_name}_file_name", type: String + field :"#{field_name}_content_type", type: String + field :"#{field_name}_file_size", type: Integer + field :"#{field_name}_updated_at", type: Time + field :"#{field_name}_fingerprint", type: String # convenience attr (RailsAdmin uses this naming) attr_accessor :"delete_#{field_name}" before_validation do self.send(field).clear if self.send(:"delete_#{field_name}").present?