Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

whitelists and blacklists can be global #52

Merged
merged 3 commits into from
May 2, 2013

Conversation

jamesarosen
Copy link
Contributor

Until now, Feature.whitelist and .blacklist took a required first argument -- the name of the feature:

Arturo::Feature.whitelist(:foo) do |recipient|
  recipient.plan.has_foo?
end

Now whitelists and blacklists can be global. The block takes the feature as the first argument:

Arturo::Feature.whitelist do |feature, recipient|
  recipient.plan.has?(feature.to_sym)
end

The former is now implemented on top of the latter.

Until now, Feature.whitelist and .blacklist took a required first
argument -- the name of the feature:

    Arturo::Feature.whitelist(:foo) do |recipient|
      recipient.plan.has_foo?
    end

Now whitelists and blacklists can be global. The block takes the feature
as the first argument:

    Arturo::Feature.whitelist do |feature, recipient|
      recipient.plan.has?(feature.to_sym)
    end
@jamesarosen
Copy link
Contributor Author

@plukevdh what do you think?

@grosser if we do this, then we can rewrite the "phased" stuff as whitelists & blacklists, which means less monkey-patching!

@grosser
Copy link
Collaborator

grosser commented May 1, 2013

Looks good!

jamesarosen added a commit that referenced this pull request May 2, 2013
whitelists and blacklists can be global
@jamesarosen jamesarosen merged commit 3e04304 into master May 2, 2013
@jamesarosen jamesarosen deleted the james/global_whitelists branch May 2, 2013 00:09
@plukevdh
Copy link
Contributor

plukevdh commented May 2, 2013

Solid.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants