From 79437642d537f24a36d9e649713941eebfff35c2 Mon Sep 17 00:00:00 2001 From: Sean Griffin Date: Tue, 28 Oct 2014 17:35:55 -0600 Subject: Implement #== for column We shouldn't rely on reference equality of these objects in tests --- activerecord/lib/active_record/connection_adapters/column.rb | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'activerecord') 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: -- cgit v1.2.3