Skip to content

Commit

Permalink
Merge pull request maxdemarzi#102 from blizkreeg/models
Browse files Browse the repository at this point in the history
ignore empty string values in typecasting
  • Loading branch information
blizkreeg committed Jan 24, 2014
2 parents 5dfbbc9 + fc06c53 commit 7c92341
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/deja/type_caster.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def self.reversecast(attr_name, value, klass)

# cast to neo4j basic types and raise errors when invalid/unrecognized data type
def self.typecast(attr_name, value, klass)
return if value.nil?
return if value.nil? || (value.is_a?(String) && value.empty?)

data_type = (klass.constantize.schema[:attributes][attr_name] || klass.constantize.composed_attributes[attr_name])[:type].to_s

Expand Down

0 comments on commit 7c92341

Please sign in to comment.