Skip to content

1.0.0.beta2

Pre-release
Pre-release

Choose a tag to compare

@rameerez rameerez released this 10 Jul 18:45
· 95 commits to main since this release

Second beta on the road to 1.0. Drop-in upgrade from 1.0.0.beta1: no migrations, no breaking API changes — and if you worked around the ClassifyJob bug below, you can now delete the workaround.

Fixed

  • Async adapters now actually run in Moderate::ClassifyJob (#3). beta1's :flag after_commit called Moderate.classify inline for every adapter — including ones declaring synchronous? == false — so a remote moderation API ran its network call inside the request that saved the content, and ClassifyJob (whose docs promised this routing) was never enqueued by anything. The concern now checks config.adapter_async?(policy.adapter) (new public helper) and enqueues the job; the job re-reads the persisted value and files the Flag itself. Hosts that enqueued ClassifyJob themselves and short-circuited moderation_field_changed_for_commit? can delete both workarounds.

Added

  • Active Storage attachments filter out of the box (#3). moderates :avatar, with: :your_image_adapter, mode: :flag on a has_one_attached model needs zero extra wiring: the concern snapshots attachment_changes in a before_save (AR dirty tracking can't see attachment writes, and Active Storage clears the changes before after_commit), consumes the snapshot at commit time, and both the concern and ClassifyJob treat an unattached ActiveStorage::Attached proxy as blank — covering purge-between-enqueue-and-run. The three moderation_field_* seam overrides remain for richer cases.
  • Flag#action!(note:, by: nil) / Flag#dismiss!(note:, by: nil) (#4) — model-level closes mirroring Report#resolve!/#dismiss!. by: stays nil for automated closes (don't fake a human reviewer in the audit trail — DSA statements of reasons read these rows). Canonical automated use: dismiss a pending flag whose flagged content was superseded (text edited, photo replaced/reverted) — left pending it keeps flagged? true and mislabels the NEW content in any host UI keyed on it.

Full test suite: 208 runs, 0 failures. Battle-tested against a production host (CarHey) running an async Claude-vision avatar adapter end-to-end.

Full changelog: v1.0.0.beta1...v1.0.0.beta2