Sha256: 380560902b94286672dd3384957083c5df91537447aa7243e2a75b83459e9ef3

Contents?: true

Size: 834 Bytes

Versions: 15

Compression:

Stored size: 834 Bytes

Contents

module Neo4j
  module Shared
    module Callbacks #:nodoc:
      extend ActiveSupport::Concern

      module ClassMethods
        include ActiveModel::Callbacks
      end

      included do
        include ActiveModel::Validations::Callbacks
        define_model_callbacks :initialize, :find, :only => :after
        define_model_callbacks :save, :create, :update, :destroy
      end

      def destroy #:nodoc:
        run_callbacks(:destroy) { super }
      end

      def touch(*) #:nodoc:
        run_callbacks(:touch) { super }
      end

      private

      def create_or_update #:nodoc:
        run_callbacks(:save) { super }
      end

      def create_model #:nodoc:
        run_callbacks(:create) { super }
      end

      def update_model(*) #:nodoc:
        run_callbacks(:update) { super }
      end
    end

  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
neo4j-4.0.0 lib/neo4j/shared/callbacks.rb
neo4j-4.0.0.rc.4 lib/neo4j/shared/callbacks.rb
neo4j-4.0.0.rc.3 lib/neo4j/shared/callbacks.rb
neo4j-4.0.0.rc.1 lib/neo4j/shared/callbacks.rb
neo4j-3.0.4 lib/neo4j/shared/callbacks.rb
neo4j-3.0.3 lib/neo4j/shared/callbacks.rb
neo4j-3.0.2 lib/neo4j/shared/callbacks.rb
neo4j-3.0.1 lib/neo4j/shared/callbacks.rb
neo4j-3.0.0 lib/neo4j/shared/callbacks.rb
neo4j-3.0.0.rc.5 lib/neo4j/shared/callbacks.rb
neo4j-3.0.0.rc.4 lib/neo4j/shared/callbacks.rb
neo4j-3.0.0.rc.3 lib/neo4j/shared/callbacks.rb
neo4j-3.0.0.rc.2 lib/neo4j/shared/callbacks.rb
neo4j-3.0.0.alpha.11 lib/neo4j/shared/callbacks.rb
neo4j-3.0.0.alpha.10 lib/neo4j/shared/callbacks.rb