lib/intercom/traits/incrementable_attributes.rb in intercom-3.5.4 vs lib/intercom/traits/incrementable_attributes.rb in intercom-3.5.5
- old
+ new
@@ -5,8 +5,14 @@
def increment(key, value=1)
existing_value = self.custom_attributes[key]
existing_value ||= 0
self.custom_attributes[key] = existing_value + value
end
+
+ def decrement(key, value=1)
+ existing_value = self.custom_attributes[key] || 0
+ self.custom_attributes[key] = existing_value - value
+ end
+
end
end
end