Permalink
Browse files

Avoid setting nil fields.

  • Loading branch information...
1 parent 17e20e1 commit ea240c1ec0a105479438f2e879086192fda11ee3 Jaime Oyarzún Knittel committed with Aug 1, 2011
Showing with 2 additions and 1 deletion.
  1. +2 −1 lib/eventbrite/api_object.rb
@@ -94,7 +94,8 @@ def init_with_hash(hash, no_dirty = false)
@attributes ||= {}
hash.each do |k, v|
- self.__send__("#{k}=", v, no_dirty) unless (self.class.ignores.include?(k) ||
+ self.__send__("#{k}=", v, no_dirty) unless (v.nil? || v.blank? ||
+ self.class.ignores.include?(k) ||
self.class.ignores.include?(k.to_sym)) ||
self.class.relations.include?(k) ||
self.class.relations.include?(k.to_sym) ||

0 comments on commit ea240c1

Please sign in to comment.