aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/connection_adapters/column.rb
diff options
context:
space:
mode:
authorSean Griffin <sean@thoughtbot.com>2014-10-28 17:52:58 -0600
committerSean Griffin <sean@thoughtbot.com>2014-10-28 17:54:03 -0600
commitec012e446ad5a502ce5fcf5139a3ed7ee9e220ba (patch)
treecadfd477c3e4505aab1ce6151d96a79708b6193e /activerecord/lib/active_record/connection_adapters/column.rb
parentcd45306dbdf229ada6783c36cbd9cc18da26954a (diff)
downloadrails-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.rb11
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