diff options
author | Sean Griffin <sean@thoughtbot.com> | 2014-10-28 17:35:55 -0600 |
---|---|---|
committer | Sean Griffin <sean@thoughtbot.com> | 2014-10-28 17:35:55 -0600 |
commit | 79437642d537f24a36d9e649713941eebfff35c2 (patch) | |
tree | c140a50b9f3e53d9d1809145c09bc79ca277b847 /activerecord/lib/active_record | |
parent | 521532342452b3024c9cb2e7ebbd7170ee0d42e5 (diff) | |
download | rails-79437642d537f24a36d9e649713941eebfff35c2.tar.gz rails-79437642d537f24a36d9e649713941eebfff35c2.tar.bz2 rails-79437642d537f24a36d9e649713941eebfff35c2.zip |
Implement #== for column
We shouldn't rely on reference equality of these objects in tests
Diffstat (limited to 'activerecord/lib/active_record')
-rw-r--r-- | activerecord/lib/active_record/connection_adapters/column.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/column.rb b/activerecord/lib/active_record/connection_adapters/column.rb index 5f9cc6edd0..cdbcca3728 100644 --- a/activerecord/lib/active_record/connection_adapters/column.rb +++ b/activerecord/lib/active_record/connection_adapters/column.rb @@ -56,6 +56,14 @@ module ActiveRecord clone.instance_variable_set('@cast_type', type) end end + + def ==(other) + other.name == name && + other.default == default && + other.cast_type == cast_type && + other.sql_type == sql_type && + other.null == null + end end end # :startdoc: |