Sha256: 55b73b18c9dc1e5cf994da5d69dccdfb30425deec710fda5d48c54cfdbd2b2a3

Contents?: true

Size: 649 Bytes

Versions: 42

Compression:

Stored size: 649 Bytes

Contents

module ActiveGraph
  module Relationship
    module Callbacks #:nodoc:
      extend ActiveSupport::Concern
      include ActiveGraph::Shared::Callbacks

      def save(*args)
        unless _persisted_obj || (from_node.respond_to?(:neo_id) && to_node.respond_to?(:neo_id))
          fail ActiveGraph::Relationship::Persistence::RelInvalidError, 'from_node and to_node must be node objects'
        end
        super(*args)
      end

      def destroy
        to_node.callbacks_from_relationship(self, :in, from_node).try(:last)
        from_node.callbacks_from_relationship(self, :out, to_node).try(:last)
        super
      end
    end
  end
end

Version data entries

42 entries across 42 versions & 1 rubygems

Version Path
activegraph-12.0.0.beta.4 lib/active_graph/relationship/callbacks.rb
activegraph-11.5.0.beta.3 lib/active_graph/relationship/callbacks.rb
activegraph-12.0.0.beta.3 lib/active_graph/relationship/callbacks.rb
activegraph-12.0.0.beta.2 lib/active_graph/relationship/callbacks.rb
activegraph-11.5.0.beta.2 lib/active_graph/relationship/callbacks.rb
activegraph-12.0.0.beta.1 lib/active_graph/relationship/callbacks.rb
activegraph-11.5.0.beta.1 lib/active_graph/relationship/callbacks.rb
activegraph-11.5.0.alpha.1 lib/active_graph/relationship/callbacks.rb
activegraph-11.4.0 lib/active_graph/relationship/callbacks.rb
activegraph-11.3.1 lib/active_graph/relationship/callbacks.rb
activegraph-11.3.0 lib/active_graph/relationship/callbacks.rb
activegraph-11.2.0 lib/active_graph/relationship/callbacks.rb
activegraph-11.1.0 lib/active_graph/relationship/callbacks.rb
activegraph-11.1.0.beta.1 lib/active_graph/relationship/callbacks.rb
activegraph-11.1.0.alpha.4 lib/active_graph/relationship/callbacks.rb
activegraph-11.1.0.alpha.3 lib/active_graph/relationship/callbacks.rb
activegraph-11.1.0.alpha.2 lib/active_graph/relationship/callbacks.rb
activegraph-11.1.0.alpha.1 lib/active_graph/relationship/callbacks.rb
activegraph-10.2.0.beta.1 lib/active_graph/relationship/callbacks.rb
activegraph-11.0.2-java lib/active_graph/relationship/callbacks.rb