Files
danbooru/app
evazion fc06a2a0f7 posts: fix members not being able to tag posts.
Fix regression caused by 3d3f61559. This is what happened:

* The posts controller calls post.visible? before post.update.
* post.visible? calls post.tag_array.
* The call to tag_array causes the current value of tag_string to be
  cached in @tag_array.
* post.update calls post.merge_old_changes.
* post.merge_old_changes accesses tag_array, which contains the old
  cached version of tag_string rather than the new version from the
  update.
* post.merge_old_changes detects no changes, so the update does nothing.
* This only happens for Members because for Gold+ users the call to
  post.visible? short circuits before accessing tag_array.

Moral of the story: cache invalidation is hard. Don't cache unless you have to.
2020-01-09 18:54:03 -06:00
..
2020-01-07 18:48:52 +00:00