Permalink
Browse files

remove bitfield virtual fields from the update list

  • Loading branch information...
peppyheppy committed Jan 26, 2012
1 parent b1a724f commit f55105671deac8ee5040e2a24fa8d87c06d48529
Showing with 4 additions and 2 deletions.
  1. +4 −2 lib/janrain/capture/user.rb
@@ -49,8 +49,10 @@ def to_capture(only_changes=false)
end
all
end
-
- attrs.delete_if { |a,v| a == 'id' || a == 'capture_id'}
+ # don't send over bitfield name/values, rather udpate the
+ # actual bitfield value i.e. send flags = 3
+ remove_attributes = self.class.bitfields.map { |b,f| f.stringify_keys.keys }.flatten
+ attrs.delete_if { |a,v| a == 'id' || a == 'capture_id' || remove_attributes.include?(a) }
attrs
end

0 comments on commit f551056

Please sign in to comment.