aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/connection_adapters/column.rb
diff options
context:
space:
mode:
authorSean Griffin <sean@thoughtbot.com>2014-06-03 08:23:30 -0600
committerSean Griffin <sean@thoughtbot.com>2014-06-03 10:27:38 -0600
commited559d4b00fbd7c6f86e75fd2d18a40e16b98281 (patch)
tree87cfc9cd37c31c4c53c2437915db4da8e8019c46 /activerecord/lib/active_record/connection_adapters/column.rb
parent098bb63ae4acc349826ab84b3e1dff985e38609c (diff)
downloadrails-ed559d4b00fbd7c6f86e75fd2d18a40e16b98281.tar.gz
rails-ed559d4b00fbd7c6f86e75fd2d18a40e16b98281.tar.bz2
rails-ed559d4b00fbd7c6f86e75fd2d18a40e16b98281.zip
Keep column defaults in type cast form
The contract of `_field_changed?` assumes that the old value is always type cast. That is not the case for the value in `Column#default` as things are today. It appears there are other public methods that assume that `Column#default` is type cast, as well. The reason for this change originally was because the value gets put into `@raw_attributes` in initialize. This reverts to the old behavior on `Column`, and updates `initialize` to make sure that the values are in the right format.
Diffstat (limited to 'activerecord/lib/active_record/connection_adapters/column.rb')
-rw-r--r--activerecord/lib/active_record/connection_adapters/column.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/column.rb b/activerecord/lib/active_record/connection_adapters/column.rb
index 60da541e3d..4d0d7ca00d 100644
--- a/activerecord/lib/active_record/connection_adapters/column.rb
+++ b/activerecord/lib/active_record/connection_adapters/column.rb
@@ -52,7 +52,7 @@ module ActiveRecord
end
def extract_default(default)
- type_cast_for_write(type_cast(default))
+ type_cast(default)
end
end
end