Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 0 additions & 24 deletions app/models/concerns/simple_workflow.rb

This file was deleted.

13 changes: 12 additions & 1 deletion app/models/topical_event.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,19 @@
class TopicalEvent < ApplicationRecord
include ActiveRecord::Transitions
include DateValidation
include PublishesToPublishingApi
include Searchable
include SimpleWorkflow

default_scope -> { where(arel_table[:state].not_eq("deleted")) }

state_machine auto_scopes: true, initial: :current do
state :current
state :deleted

event :delete, success: ->(document) { document.remove_from_search_index if document.respond_to?(:remove_from_search_index) } do
transitions from: [:current], to: :deleted
end
end

date_attributes(:start_date, :end_date)

Expand Down
42 changes: 0 additions & 42 deletions test/unit/app/models/simple_workflow_test.rb

This file was deleted.