Skip to content

Commit

Permalink
Delegate ActiveJobJob.table_name to Execution and prevent it from…
Browse files Browse the repository at this point in the history
… being directly assignable
  • Loading branch information
bensheldon committed Mar 3, 2022
1 parent ca92be4 commit 1765036
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion lib/good_job/active_job_job.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,14 @@ class ActiveJobJob < BaseRecord
# Attached to a Job's Execution when the Job is discarded.
DiscardJobError = Class.new(StandardError)

self.table_name = 'good_jobs'
class << self
delegate :table_name, to: Execution

def table_name=(_value)
raise NotImplementedError, 'Assign GoodJob::Execution.table_name directly'
end
end

self.primary_key = 'active_job_id'
self.advisory_lockable_column = 'active_job_id'

Expand Down

0 comments on commit 1765036

Please sign in to comment.