Module: ActiveGraph::Node::Validations

Extended by:
ActiveSupport::Concern
Includes:
Shared::Validations
Included in:
ActiveGraph::Node
Defined in:
lib/active_graph/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:



9
10
11
12
13
# File 'lib/active_graph/node/validations.rb', line 9

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