lib/rocket_job/dirmon_entry.rb in rocketjob-3.0.3 vs lib/rocket_job/dirmon_entry.rb in rocketjob-3.0.4

- old
+ new

@@ -76,11 +76,11 @@ # :pending -> :enabled -> :disabled # -> :failed # -> :failed -> :active # -> :disabled # -> :disabled -> :active - aasm column: :state do + aasm column: :state, whiny_persistence: true do # DirmonEntry is `pending` until it is approved state :pending, initial: true # DirmonEntry is Enabled and will be included by DirmonJob state :enabled @@ -234,10 +234,10 @@ # Skip archive directories next if file_name.include?(self.class.default_archive_directory) # Security check? - if (whitelist_paths.size > 0) && whitelist_paths.none? { |whitepath| file_name.start_with?(whitepath) } + if (whitelist_paths.size > 0) && whitelist_paths.none? { |whitepath| file_name.to_s.start_with?(whitepath) } logger.error "Skipping file: #{file_name} since it is not in any of the whitelisted paths: #{whitelist_paths.join(', ')}" next end # File must be writable so it can be removed after processing