Permalink
Browse files

Risky#cast: don't override false, only nil.

  • Loading branch information...
Kyle Kingsbury
Kyle Kingsbury committed Oct 4, 2011
1 parent 7e74007 commit 1326e0d56c87c96fc104c9b1a1b1d0b1fca7e5df
Showing with 3 additions and 1 deletion.
  1. +3 −1 lib/risky.rb
View
@@ -419,7 +419,9 @@ def load_riak_object(riak_object, opts = {:merge => true})
# Not merging
self.values = self.class.cast(MultiJson.decode(riak_object.raw_data)) rescue {}
self.class.values.each do |k, v|
- values[k] ||= (v[:default].clone rescue v[:default])
+ if values[k].nil?
+ values[k] = (v[:default].clone rescue v[:default])
+ end
end
self.riak_object = riak_object
self.new = false

0 comments on commit 1326e0d

Please sign in to comment.