diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2013-03-14 17:15:24 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2013-03-14 17:15:24 -0700 |
commit | d5f4b5382afc04eb760be02c87db61d907f0ea1b (patch) | |
tree | 175caeefa8e0b93688ee3d20630c61b91c55fa8e /activerecord/lib | |
parent | b7b6c22d7807c7f587dcde90ea30f98f17278d1a (diff) | |
download | rails-d5f4b5382afc04eb760be02c87db61d907f0ea1b.tar.gz rails-d5f4b5382afc04eb760be02c87db61d907f0ea1b.tar.bz2 rails-d5f4b5382afc04eb760be02c87db61d907f0ea1b.zip |
extract factory method and push common code up to abstract adapter
Diffstat (limited to 'activerecord/lib')
-rw-r--r-- | activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb | 7 | ||||
-rw-r--r-- | activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb | 7 |
2 files changed, 7 insertions, 7 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 42206de8fc..a7c7124122 100644 --- a/activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb +++ b/activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb @@ -16,7 +16,6 @@ module ActiveRecord # +columns+ attribute of said TableDefinition object, in order to be used # for generating a number of table creation or table changing SQL statements. class ColumnDefinition < Struct.new(:base, :name, :type, :limit, :precision, :scale, :default, :null) #:nodoc: - def string_to_binary(value) value end @@ -296,8 +295,12 @@ module ActiveRecord end private + def create_column_definition(base, name, type) + ColumnDefinition.new base, name, type + end + def new_column_definition(base, name, type) - definition = ColumnDefinition.new base, name, type + definition = create_column_definition base, name, type @columns << definition @columns_hash[name] = definition definition diff --git a/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb b/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb index a2109444b7..a9600c0544 100644 --- a/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb +++ b/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb @@ -340,11 +340,8 @@ module ActiveRecord private - def new_column_definition(base, name, type) - definition = ColumnDefinition.new base, name, type - @columns << definition - @columns_hash[name] = definition - definition + def create_column_definition(base, name, type) + ColumnDefinition.new base, name, type end end |