Skip to content

Commit

Permalink
Move shared BaseExecution concerns into the base class. (#1009)
Browse files Browse the repository at this point in the history
Parent/base class for `Job and Execution` is `BaseExecution`, both of
these child classes include same concerns: `Lockable, Filterable, Reportable`.

This commit moves inclusion of these concerns to the base class
`BaseExecution`
  • Loading branch information
dixpac authored Jul 18, 2023
1 parent a137fed commit e39e234
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 8 deletions.
3 changes: 3 additions & 0 deletions app/models/good_job/base_execution.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ module GoodJob
# which both read out of the same table.
class BaseExecution < BaseRecord
include ErrorEvents
include Filterable
include Lockable
include Reportable

self.table_name = 'good_jobs'

Expand Down
4 changes: 0 additions & 4 deletions app/models/good_job/execution.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@
module GoodJob
# ActiveRecord model that represents an +ActiveJob+ job.
class Execution < BaseExecution
include Lockable
include Filterable
include Reportable

# Raised if something attempts to execute a previously completed Execution again.
PreviouslyPerformedError = Class.new(StandardError)

Expand Down
4 changes: 0 additions & 4 deletions app/models/good_job/job.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,6 @@ module GoodJob
# A single row from the +good_jobs+ table of executions is fetched to represent a Job.
#
class Job < BaseExecution
include Filterable
include Lockable
include Reportable

# Raised when an inappropriate action is applied to a Job based on its state.
ActionForStateMismatchError = Class.new(StandardError)
# Raised when an action requires GoodJob to be the ActiveJob Queue Adapter but GoodJob is not.
Expand Down

0 comments on commit e39e234

Please sign in to comment.