Sha256: 737a32a52bd1279438a57a733f502c8b27de7bf9b3f9dbde4410835f6a8ad21c

Contents?: true

Size: 957 Bytes

Versions: 34

Compression:

Stored size: 957 Bytes

Contents

module Neo4j
	module Rails
		module Serialization
			extend ActiveSupport::Concern
			
			included do
				include ActiveModel::Serializers::Xml
        include ActiveModel::Serializers::JSON
				# Patch for ActiveModel's XML serializer.  There is a bug in the original where
				# raw_value is used in the initializer and so demands always that the object being 
				# serialized is sent the attribute's name as a method call.  This causes a problem
				# for Neo4j properties that aren't declared and so don't have methods to call.  Besides
				# which it's not necessary to re-call to get the value again if it has already
				# been passed.
				class ActiveModel::Serializers::Xml::Serializer::Attribute
					def initialize(name, serializable, raw_value=nil)
            @name, @serializable = name, serializable
            @value = raw_value || @serializable.send(name)
            @type  = compute_type
          end
        end
			end
		end
	end
end

Version data entries

34 entries across 34 versions & 1 rubygems

Version Path
neo4j-2.3.0-java lib/neo4j/rails/serialization.rb
neo4j-2.2.4-java lib/neo4j/rails/serialization.rb
neo4j-2.2.3-java lib/neo4j/rails/serialization.rb
neo4j-2.2.1-java lib/neo4j/rails/serialization.rb
neo4j-2.2.0-java lib/neo4j/rails/serialization.rb
neo4j-2.2.0.rc1-java lib/neo4j/rails/serialization.rb
neo4j-2.0.1-java lib/neo4j/rails/serialization.rb
neo4j-2.0.0-java lib/neo4j/rails/serialization.rb
neo4j-2.0.0.rc2-java lib/neo4j/rails/serialization.rb
neo4j-2.0.0.rc1-java lib/neo4j/rails/serialization.rb
neo4j-2.0.0.alpha.9-java lib/neo4j/rails/serialization.rb
neo4j-2.0.0.alpha.8-java lib/neo4j/rails/serialization.rb
neo4j-2.0.0.alpha.7-java lib/neo4j/rails/serialization.rb
neo4j-2.0.0.alpha.6-java lib/neo4j/rails/serialization.rb
neo4j-2.0.0.alpha.5-java lib/neo4j/rails/serialization.rb
neo4j-2.0.0.alpha.4-java lib/neo4j/rails/serialization.rb
neo4j-2.0.0.alpha.3-java lib/neo4j/rails/serialization.rb
neo4j-1.3.1-java lib/neo4j/rails/serialization.rb
neo4j-1.3.0-java lib/neo4j/rails/serialization.rb
neo4j-1.2.6-java lib/neo4j/rails/serialization.rb