aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorTeddy Wing2017-09-25 12:22:29 +0200
committerTeddy Wing2017-09-25 12:22:29 +0200
commit75c7bc19c318ace8136ee94c2a09952226c0b7de (patch)
tree17159eb851f379afded98caffabaa8748714a24c /lib
parentf4034d9d176a6402de135acd91dc34d7b39dbf4a (diff)
downloadchouette-core-75c7bc19c318ace8136ee94c2a09952226c0b7de.tar.bz2
ModelAttribute#==: Check for matching class type
Thanks to Robert for this suggestion, of course it makes a lot of sense to verify class equivalence when checking equality. Refs #4401
Diffstat (limited to 'lib')
-rw-r--r--lib/model_attribute.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/model_attribute.rb b/lib/model_attribute.rb
index 9d821f551..4d246853a 100644
--- a/lib/model_attribute.rb
+++ b/lib/model_attribute.rb
@@ -93,7 +93,8 @@ class ModelAttribute
end
def ==(other)
- klass == other.klass &&
+ self.class === other &&
+ klass == other.klass &&
name == other.name &&
data_type == other.data_type
end