Module: ActiveRecord::Schema::Definition

Extended by:
ActiveSupport::Concern
Included in:
ActiveRecord::Schema
Defined in:
lib/active_record/schema.rb

Defined Under Namespace

Modules: ClassMethods

Instance Method Summary collapse

Instance Method Details

#define(info, &block) ⇒ Object

:nodoc:



54
55
56
57
58
59
60
61
62
63
64
65
# File 'lib/active_record/schema.rb', line 54

def define(info, &block) # :nodoc:
  connection_pool.with_connection do |connection|
    instance_eval(&block)

    connection_pool.schema_migration.create_table
    if info[:version].present?
      connection.assume_migrated_upto_version(info[:version])
    end

    connection_pool..create_table_and_set_flags(connection_pool.migration_context.current_environment)
  end
end