Module: Noah::EphemeralValidations

Included in:
Ephemeral
Defined in:
lib/noah/validations/ephemeral_validations.rb

Instance Method Summary collapse

Instance Method Details

#assert_not_reserved(error = [:path, :reserved_path]) ⇒ Object



4
5
6
7
8
9
10
# File 'lib/noah/validations/ephemeral_validations.rb', line 4

def assert_not_reserved(error = [:path, :reserved_path])
  # This is to work around how Ohm evaluates validations
  # Allows assert_present :path to override
  return if self.path.nil?
  # This is the real test
  self.instance_of?(Noah::Ephemeral) ? (assert valid_path?, error) : (assert false, "Validation not applicable")
end