lib/rocket_job/dirmon_entry.rb in rocketjob-6.0.3 vs lib/rocket_job/dirmon_entry.rb in rocketjob-6.1.0
- old
+ new
@@ -69,10 +69,11 @@
before_validation :strip_whitespace
validates_presence_of :pattern, :job_class_name, :archive_directory
validate :job_is_a_rocket_job
validate :job_has_properties
+ validates_uniqueness_of :pattern, :name
# State Machine events and transitions
#
# :pending -> :enabled -> :disabled
# -> :failed
@@ -95,9 +96,10 @@
state :disabled
event :enable do
transitions from: :pending, to: :enabled
transitions from: :disabled, to: :enabled
+ transitions from: :failed, to: :enabled
end
event :disable do
transitions from: :enabled, to: :disabled
transitions from: :failed, to: :disabled