From 20aed4495bfa0a1f7844501c9118bd2369fe460b Mon Sep 17 00:00:00 2001 From: hsbt Date: Tue, 22 Aug 2017 06:34:27 +0000 Subject: Fixed equality method fails when given the object that doesn't support table method. [Bug #12422][ruby-core:75707] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59641 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- lib/csv.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lib/csv.rb') diff --git a/lib/csv.rb b/lib/csv.rb index 45a087ff0f..b16e817d09 100644 --- a/lib/csv.rb +++ b/lib/csv.rb @@ -870,7 +870,8 @@ class CSV # Returns +true+ if all rows of this table ==() +other+'s rows. def ==(other) - @table == other.table + return @table == other.table if other.is_a? CSV::Table + @table == other end # -- cgit v1.2.3