Sha256: 061aa8f52b870e2c5e821743d30bfde85ddb2ea686f08192770756a4496ed457

Contents?: true

Size: 618 Bytes

Versions: 13

Compression:

Stored size: 618 Bytes

Contents

# encoding: utf-8

require 'dm-core'

module CarrierWave
  module DataMapper

    include CarrierWave::Mount

    ##
    # See +CarrierWave::Mount#mount_uploader+ for documentation
    #
    def mount_uploader(column, uploader, options={}, &block)
      super

      alias_method :read_uploader, :attribute_get
      alias_method :write_uploader, :attribute_set

      after :save, "store_#{column}!".to_sym
      before :save, "write_#{column}_identifier".to_sym
      after :destroy, "remove_#{column}!".to_sym
    end

  end # DataMapper
end # CarrierWave

DataMapper::Model.send(:include, CarrierWave::DataMapper)

Version data entries

13 entries across 13 versions & 4 rubygems

Version Path
andrewtimberlake-carrierwave-0.3.2.1 lib/carrierwave/orm/datamapper.rb
durran-carrierwave-0.3.2.3 lib/carrierwave/orm/datamapper.rb
jnicklas-carrierwave-0.3.2.1 lib/carrierwave/orm/datamapper.rb
jnicklas-carrierwave-0.3.2 lib/carrierwave/orm/datamapper.rb
jnicklas-carrierwave-0.3.3 lib/carrierwave/orm/datamapper.rb
carrierwave-0.4.1 lib/carrierwave/orm/datamapper.rb
carrierwave-0.4.0 lib/carrierwave/orm/datamapper.rb
carrierwave-0.3.5.2 lib/carrierwave/orm/datamapper.rb
carrierwave-0.3.5.1 lib/carrierwave/orm/datamapper.rb
carrierwave-0.3.5 lib/carrierwave/orm/datamapper.rb
carrierwave-0.3.4 lib/carrierwave/orm/datamapper.rb
carrierwave-0.3.3 lib/carrierwave/orm/datamapper.rb
carrierwave-0.3.2 lib/carrierwave/orm/datamapper.rb