module HealthInspector::ExistenceValidations

Mixins for common validations across pairings

Public Instance Methods

validate_existence() click to toggle source
# File lib/health_inspector/pairing.rb, line 72
def validate_existence
  if local.nil? && server.nil?
    errors.add 'does not exist locally or on server'
    return
  end

  validate_local_copy_exists
  validate_server_copy_exists
end

Private Instance Methods

validate_local_copy_exists() click to toggle source
# File lib/health_inspector/pairing.rb, line 84
def validate_local_copy_exists
  errors.add 'exists on server but not locally' if local.nil?
end
validate_server_copy_exists() click to toggle source
# File lib/health_inspector/pairing.rb, line 88
def validate_server_copy_exists
  errors.add 'exists locally but not on server' if server.nil?
end