I've attached a patch that takes a first step towards decoupling Journal from Issue .
it introduces a new acts_as_journalized act which allows journalized models to provide their own Journal-related behavior.
Issue now registers itself using:
acts_as_journalized activity_type: 'issues'
The activity provider registration is optional and journalized models can participate in the journaling infrastructure without exposing activity events.
The patch also removes the remaining assumption that a Journal is always associated with an Issue.
In particular, the temporary belongs_to :issue association used for eager loading is no longer required and Journal relies on the polymorphic journalized association instead.
Visibility, activity and permission handling are delegated to the journalized model through the new API.
This includes model-specific joins and scopes used by Journal.visible , allowing each journalized model to define its own visibility requirements.
The patch focuses on behaviors currently implemented directly in Journal, including:
- activity provider registration and activity-specific scopes
- event title, event type and event URL generation
- journal visibility and private note visibility handling
- notification delivery
- watcher processing
- relation visibility checks
- editability checks
- project lookup and journalized record visibility
The current behavior for issues is preserved.
I intentionally did not try to generalize routes, controllers or other Issue-specific UI flows at this stage.
The goal of this patch is solely to decouple Journal from Issue and provide the necessary extension points for future journalized models.
I'm interested in feedback on whether this direction makes sense and could serve as a foundation for further Journal decoupling work.