lib/balloon/up.rb in balloon-1.1.0 vs lib/balloon/up.rb in balloon-1.1.1

- old
+ new

@@ -49,18 +49,20 @@ key :width, Integer key :height, Integer key :content_type, String key :file_size, Integer key :storage, String + key :metadata key :created_at elsif defined?(Mongoid) field :file_name, type: String field :width, type: Integer field :height, type: Integer field :content_type, type: String field :file_size, type: String field :storage, type: String + field :metadata field :created_at end before_create :save_db after_destroy :uploader_delete @@ -72,9 +74,12 @@ self.content_type = meta[:mime_type] self.file_size = meta[:size] self.storage = store_storage.to_s self.width = meta[:width] self.height = meta[:height] + if self.respond_to?(:metadata) + self.metadata = meta[:data] + end end def url(size_name = nil) return "" if !respond_to?(:file_name) || file_name.nil? extension = self.file_name.to_s.match(%r"(?!\\.{1})\\w{2,}$")