Sha256: d0ee9b57b69f3064aa14ce61079fd5461333f9feb9947dae59047dbee14f3af6

Contents?: true

Size: 468 Bytes

Versions: 1

Compression:

Stored size: 468 Bytes

Contents

# use "use_couchrest_model" in the DSL or
# include this module in a migration to use CouchRest::Model
if defined?(CouchRest::CouchRest::Model)
  module CouchRest
    module Model
      class Base
        before_save :rewrite_type_for_migration_classes

        def rewrite_type_for_migration_classes
          class_name = self.class.to_s.sub(/CouchMigrate::BaseExecuter::Namespaced::/, '')
          self['type'] = class_name
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
couch-migrate-1.0.0 lib/couch_migrate/couchrest_model/extend.rb