mirror of
https://github.com/discourse/discourse.git
synced 2024-11-26 05:53:38 +08:00
c996b7fe4b
Prior to this fix `context.membership&.update!(last_viewed_at: Time.zone.now)` would generate an update statement from a GET request which is not permitted by default when in readonly mode. The usual fix in this case is to check for readonly or rescue an error, however, this common pattern of updating "last seen" or similar can be better handled in a `Schedule::Defer` block, which won't raise the `ActiveRecord::ReadOnlyError` when in readonly and will also prevent the controller to wait for this operation. |
||
---|---|---|
.. | ||
chat | ||
checklist | ||
discourse-details | ||
discourse-lazy-videos | ||
discourse-local-dates | ||
discourse-narrative-bot | ||
discourse-presence | ||
poll | ||
styleguide |