rollout_ui icon indicating copy to clipboard operation
rollout_ui copied to clipboard

why not use @rollout.features in wrapper.rb

Open dfguo opened this issue 11 years ago • 3 comments

If you use redis namespace, redis.smembers(:features) will not work. I changed it to @rollout.features, but it breaks a bunch of tests.

I'm not entirely sure why we need to have #add_feature in wrapper.rb, so I'm really having trouble refactoring it. What's the reason behind using redis.smembers(:features) instead of @rollout.features? Thanks!

dfguo avatar Feb 24 '14 09:02 dfguo

Probably just legacy, as iirc, that wasn't available when I originally wrote this. Switching it over would be great.

jrallison avatar Feb 24 '14 10:02 jrallison

I have some trouble understanding few parts of the code and can't proceed with the refactoring. Particularly with monkey_patch.rb

  def active?(feature, user=nil)
    RolloutUi::Wrapper.new(self).add_feature(feature)
    original_active?(feature, user)
  end

why do we add the feature in here?

dfguo avatar Feb 24 '14 12:02 dfguo

#25 is a refactoring to use native rollout features method.

dfguo avatar Mar 12 '14 07:03 dfguo