Sha256: 950ffcf6a07a7425353c2d9be861fc8fa6bc5a97e99b8ae253d2b942a112ad86

Contents?: true

Size: 935 Bytes

Versions: 6

Compression:

Stored size: 935 Bytes

Contents

module Neo4j
	module Rails
		module Callbacks #:nodoc:
			extend ActiveSupport::Concern
			
			included do
				[:valid?, :create_or_update, :create, :update, :destroy].each do |method|
					alias_method_chain method, :callbacks
				end
				
				extend ActiveModel::Callbacks
				
				define_model_callbacks :validation, :create, :save, :update, :destroy
			end
			
			def valid_with_callbacks?(*) #:nodoc:
			  _run_validation_callbacks { valid_without_callbacks? }
			end
			
			def destroy_with_callbacks #:nodoc:
				_run_destroy_callbacks { destroy_without_callbacks }
			end
			
			private
			def create_or_update_with_callbacks #:nodoc:
				_run_save_callbacks { create_or_update_without_callbacks }
			end
	
			def create_with_callbacks #:nodoc:
				_run_create_callbacks { create_without_callbacks }
			end
	
			def update_with_callbacks(*) #:nodoc:
				_run_update_callbacks { update_without_callbacks }
			end
		end
	end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
neo4j-1.2.1-java lib/neo4j/rails/callbacks.rb
neo4j-1.2.0-java lib/neo4j/rails/callbacks.rb
neo4j-1.1.4-java lib/neo4j/rails/callbacks.rb
neo4j-1.1.3-java lib/neo4j/rails/callbacks.rb
neo4j-1.1.2-java lib/neo4j/rails/callbacks.rb
neo4j-1.1.1-java lib/neo4j/rails/callbacks.rb