Please sign in to comment.
posts: fix members not being able to tag posts.
Fix regression caused by 3d3f615. 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.
- Loading branch information