提交 e407eb3d 编写于 作者: A Aaron Patterson

Merge pull request #4620 from carlosantoniodasilva/counter-cache-old-code

Remove not used if..else clause
......@@ -19,12 +19,6 @@ def reset_counters(id, *counters)
counters.each do |association|
has_many_association = reflect_on_association(association.to_sym)
if has_many_association.options[:as]
has_many_association.options[:as].to_s.classify
else
self.name
end
foreign_key = has_many_association.foreign_key.to_s
child_class = has_many_association.klass
belongs_to = child_class.reflect_on_all_associations(:belongs_to)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册