Module: ActiveRecord::Schema::Definition

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

Defined Under Namespace

Modules: ClassMethods

Instance Method Summary collapse

Methods included from ActiveSupport::Concern

append_features, class_methods, extended, included, prepend_features, prepended

Instance Method Details

#define(info, &block) ⇒ Object

:nodoc:



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

def define(info, &block) # :nodoc:
  instance_eval(&block)

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

  connection..create_table_and_set_flags(connection.migration_context.current_environment)
end