lib/rocket_job/job.rb in rocketjob-1.2.1 vs lib/rocket_job/job.rb in rocketjob-1.3.0

- old
+ new

@@ -118,9 +118,23 @@ # Store all job types in this collection set_collection_name 'rocket_job.jobs' validates_presence_of :state, :failure_count, :created_at, :perform_method validates :priority, inclusion: 1..100 + validates :log_level, inclusion: SemanticLogger::LEVELS + [nil] + + # User definable properties in Dirmon Entry + def self.rocket_job_properties + @rocket_job_properties ||= (self == RocketJob::Job ? [] : superclass.rocket_job_properties) + end + + # Add to user definable properties in Dirmon Entry + def self.public_rocket_job_properties(*properties) + rocket_job_properties.concat(properties).uniq! + end + + # User definable properties in Dirmon Entry + public_rocket_job_properties :description, :priority, :perform_method, :log_level, :arguments # State Machine events and transitions # # :queued -> :running -> :completed # -> :paused -> :running