app/models/line_referential_sync.rb
# There can be only one instance running
There can be only one instance running
There can be only one instance running
def multiple_process_validation
    if self.class.where(status: [:new, :pending], line_referential_id: line_referential_id).count > 0
      errors.add(:base, :multiple_process)
    end
  end
def multiple_process_validation if self . class . where ( status : [ :new , :pending ] , line_referential_id : line_referential_id ) . count > 0 errors . add ( :base , :multiple_process ) end end
There can be only one instance running
There can be only one instance running