Module: Neo4j::ActiveNode::Validations

Extended by:
ActiveSupport::Concern
Includes:
Shared::Validations
Included in:
Neo4j::ActiveNode
Defined in:
lib/neo4j/active_node/validations.rb

Overview

This mixin replace the original save method and performs validation before the save.

Defined Under Namespace

Modules: ClassMethods Classes: UniquenessValidator

Instance Method Summary collapse

Methods included from Shared::Validations

#read_attribute_for_validation, #save

Instance Method Details

#valid?(context = nil) ⇒ Boolean

Returns true if valid.

Returns:



10
11
12
13
14
# File 'lib/neo4j/active_node/validations.rb', line 10

def valid?(context = nil)
  context ||= (new_record? ? :create : :update)
  super(context)
  errors.empty?
end