aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2013-03-15 19:49:13 -0700
committerAaron Patterson <aaron.patterson@gmail.com>2013-03-22 16:22:00 -0700
commita80bcc395cd691f5a1ad11af8ad9cff1ab79163f (patch)
treee19e32ca65af82a57dcb2958be4fbfc9c0603b3e /activerecord/lib
parent1c9f7fa6e17d3b026ad6e0bc1f07a9dd47d8a360 (diff)
downloadrails-a80bcc395cd691f5a1ad11af8ad9cff1ab79163f.tar.gz
rails-a80bcc395cd691f5a1ad11af8ad9cff1ab79163f.tar.bz2
rails-a80bcc395cd691f5a1ad11af8ad9cff1ab79163f.zip
mostly decouple TableDefinition from the database connection
Diffstat (limited to 'activerecord/lib')
-rw-r--r--activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb6
-rw-r--r--activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb2
-rw-r--r--activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb2
3 files changed, 5 insertions, 5 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb b/activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb
index dd1be694e4..d6d33e9d17 100644
--- a/activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb
+++ b/activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb
@@ -50,11 +50,11 @@ module ActiveRecord
# that have been defined.
attr_accessor :columns, :indexes
- def initialize(base)
+ def initialize(types)
@columns = []
@columns_hash = {}
@indexes = {}
- @base = base
+ @native = types
end
# Appends a primary key definition to the table definition.
@@ -281,7 +281,7 @@ module ActiveRecord
end
def native
- @base.native_database_types
+ @native
end
end
diff --git a/activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb b/activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb
index 4b5adb1d59..b291c47742 100644
--- a/activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb
+++ b/activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb
@@ -830,7 +830,7 @@ module ActiveRecord
private
def create_table_definition
- TableDefinition.new(self)
+ TableDefinition.new native_database_types
end
def update_table_definition(table_name, base)
diff --git a/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb b/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb
index 48a3d5439f..ef1bbed04b 100644
--- a/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb
+++ b/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb
@@ -901,7 +901,7 @@ module ActiveRecord
end
def create_table_definition
- TableDefinition.new(self)
+ TableDefinition.new native_database_types
end
def update_table_definition(table_name, base)