jrallison / rollout_ui

RolloutUI: A slick way to rollout features in your web app.
MIT License
137 stars 86 forks source link

why not use @rollout.features in wrapper.rb #24

Open dfguo opened 10 years ago

dfguo commented 10 years ago

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!

jrallison commented 10 years ago

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

dfguo commented 10 years ago

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 commented 10 years ago

25 is a refactoring to use native rollout features method.