Created
October 17, 2014 17:13
-
-
Save biscuitvile/7af34a8192b5d8224102 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class ProductLimitPolicy | |
| def initialize(account) | |
| @account = account | |
| end | |
| def self.allow?(account) | |
| new(account).allow? | |
| end | |
| def allow? | |
| @account.products.count < @account.plan.limit_products | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment