提交 5e32f976 编写于 作者: J Jean Boussier

Set _after_create_counter_called flag to make update counter cache work

上级 7e28b4ed
......@@ -134,7 +134,12 @@ def clear_destroy_state
def _create_record(*)
id = super
each_counter_cached_associations(&:increment_counters)
each_counter_cached_associations do |association|
if record = send(association.reflection.name)
association.increment_counters
@_after_create_counter_called = true
end
end
id
end
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册