提交 2ed80970 编写于 作者: A Aaron Patterson

calling super is super. if the other object is exactly equal, we can return early

上级 06c72c43
...@@ -130,7 +130,11 @@ def class_name ...@@ -130,7 +130,11 @@ def class_name
# Returns +true+ if +self+ and +other_aggregation+ have the same +name+ attribute, +active_record+ attribute, # Returns +true+ if +self+ and +other_aggregation+ have the same +name+ attribute, +active_record+ attribute,
# and +other_aggregation+ has an options hash assigned to it. # and +other_aggregation+ has an options hash assigned to it.
def ==(other_aggregation) def ==(other_aggregation)
other_aggregation.kind_of?(self.class) && name == other_aggregation.name && other_aggregation.options && active_record == other_aggregation.active_record super ||
other_aggregation.kind_of?(self.class) &&
name == other_aggregation.name &&
other_aggregation.options &&
active_record == other_aggregation.active_record
end end
def sanitized_conditions #:nodoc: def sanitized_conditions #:nodoc:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册