aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/connection_adapters/postgresql/column.rb
diff options
context:
space:
mode:
authorSean Griffin <sean@thoughtbot.com>2014-05-21 10:11:30 -0700
committerSean Griffin <sean@thoughtbot.com>2014-05-21 10:11:30 -0700
commitb871b3fab5f0e82e80310cde8476ab7234b7b6f6 (patch)
treead378b7b3ec443158e81db5b18cd1cd2fd03b3ec /activerecord/lib/active_record/connection_adapters/postgresql/column.rb
parentb042f21c93959e0247d447f37644815bdc6d5851 (diff)
downloadrails-b871b3fab5f0e82e80310cde8476ab7234b7b6f6.tar.gz
rails-b871b3fab5f0e82e80310cde8476ab7234b7b6f6.tar.bz2
rails-b871b3fab5f0e82e80310cde8476ab7234b7b6f6.zip
Rename `oid_type` to `cast_type` to make PG columns consistent
Diffstat (limited to 'activerecord/lib/active_record/connection_adapters/postgresql/column.rb')
-rw-r--r--activerecord/lib/active_record/connection_adapters/postgresql/column.rb9
1 files changed, 4 insertions, 5 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/postgresql/column.rb b/activerecord/lib/active_record/connection_adapters/postgresql/column.rb
index 95f52312a5..80c79642f3 100644
--- a/activerecord/lib/active_record/connection_adapters/postgresql/column.rb
+++ b/activerecord/lib/active_record/connection_adapters/postgresql/column.rb
@@ -6,16 +6,15 @@ module ActiveRecord
class PostgreSQLColumn < Column #:nodoc:
attr_accessor :array
- def initialize(name, default, oid_type, sql_type = nil, null = true)
- @oid_type = oid_type
+ def initialize(name, default, cast_type, sql_type = nil, null = true)
default_value = self.class.extract_value_from_default(default)
if sql_type =~ /\[\]$/
@array = true
- super(name, default_value, oid_type, sql_type[0..sql_type.length - 3], null)
+ super(name, default_value, cast_type, sql_type[0..sql_type.length - 3], null)
else
@array = false
- super(name, default_value, oid_type, sql_type, null)
+ super(name, default_value, cast_type, sql_type, null)
end
@default_function = default if has_default_function?(default_value, default)
@@ -105,7 +104,7 @@ module ActiveRecord
end
def accessor
- @oid_type.accessor
+ cast_type.accessor
end
private