lib/flipper/adapters/redis.rb in flipper-redis-0.17.1 vs lib/flipper/adapters/redis.rb in flipper-redis-0.17.2

- old
+ new

@@ -32,14 +32,12 @@ true end # Public: Removes a feature from the set of known features. def remove(feature) - @client.multi do - @client.srem FeaturesKey, feature.key - @client.del feature.key - end + @client.srem FeaturesKey, feature.key + @client.del feature.key true end # Public: Clears the gate values for a feature. def clear(feature) @@ -71,10 +69,13 @@ # thing - The Flipper::Type being enabled for the gate. # # Returns true. def enable(feature, gate, thing) case gate.data_type - when :boolean, :integer + when :boolean + clear(feature) + @client.hset feature.key, gate.key, thing.value.to_s + when :integer @client.hset feature.key, gate.key, thing.value.to_s when :set @client.hset feature.key, to_field(gate, thing), 1 else unsupported_data_type gate.data_type