Sha256: ec0975ae21d392ebaef34d04426470bba1cc83e6e0e40feaacb0ca3e76c50a4f
Contents?: true
Size: 615 Bytes
Versions: 17
Compression:
Stored size: 615 Bytes
Contents
require 'carrierwave/mongoid' module CarrierWave module Mongoid def mount_uploader_with_localization(column, uploader=nil, options={}, &block) mount_uploader_without_localization(column, uploader, options, &block) define_method(:read_uploader) do |name| # puts "read_uploader #{name} / #{read_attribute(name.to_sym).inspect}" # DEBUG value = read_attribute(name.to_sym) unless value.nil? self.class.fields[name.to_s].deserialize(value) else nil end end end alias_method_chain :mount_uploader, :localization end end
Version data entries
17 entries across 17 versions & 1 rubygems