Sha256: c3ce93bec6aa5f1e5a2d9d38e39276fd847c261aaacafb05361c21d785ce2774

Contents?: true

Size: 421 Bytes

Versions: 2

Compression:

Stored size: 421 Bytes

Contents

# MigrationProxy is used to defer loading of the actual migration classes
# until they are needed
module Mongrations
  class MigrationProxy

    attr_accessor :name, :version, :filename

    delegate :migrate, :announce, :write, :to=>:migration

    private

      def migration
        @migration ||= load_migration
      end

      def load_migration
        load(filename)
        name.constantize
      end

  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
leifcr-mongrations-0.1.7 lib/mongrations/migration_proxy.rb
leifcr-mongrations-0.1.6 lib/mongrations/migration_proxy.rb