diff options
author | Sean Griffin <sean@thoughtbot.com> | 2014-10-28 17:52:58 -0600 |
---|---|---|
committer | Sean Griffin <sean@thoughtbot.com> | 2014-10-28 17:54:03 -0600 |
commit | ec012e446ad5a502ce5fcf5139a3ed7ee9e220ba (patch) | |
tree | cadfd477c3e4505aab1ce6151d96a79708b6193e /activerecord/lib/active_record/connection_adapters/column.rb | |
parent | cd45306dbdf229ada6783c36cbd9cc18da26954a (diff) | |
download | rails-ec012e446ad5a502ce5fcf5139a3ed7ee9e220ba.tar.gz rails-ec012e446ad5a502ce5fcf5139a3ed7ee9e220ba.tar.bz2 rails-ec012e446ad5a502ce5fcf5139a3ed7ee9e220ba.zip |
Add mysql and pg specific attributes to Column#== and hash
Diffstat (limited to 'activerecord/lib/active_record/connection_adapters/column.rb')
-rw-r--r-- | activerecord/lib/active_record/connection_adapters/column.rb | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/column.rb b/activerecord/lib/active_record/connection_adapters/column.rb index 01f06af348..dd303c73d5 100644 --- a/activerecord/lib/active_record/connection_adapters/column.rb +++ b/activerecord/lib/active_record/connection_adapters/column.rb @@ -62,12 +62,19 @@ module ActiveRecord other.default == default && other.cast_type == cast_type && other.sql_type == sql_type && - other.null == null + other.null == null && + other.default_function == default_function end alias :eql? :== def hash - [self.class, name, default, cast_type, sql_type, null].hash + attributes_for_hash.hash + end + + private + + def attributes_for_hash + [self.class, name, default, cast_type, sql_type, null, default_function] end end end |