aboutsummaryrefslogtreecommitdiffstats
path: root/app/controllers/concerns/feature_checker.rb
diff options
context:
space:
mode:
authorAlban Peignier2017-12-20 21:06:41 +0100
committerAlban Peignier2017-12-20 21:06:41 +0100
commit3305dca57e2e0a46b583f183040a82819ffd6efb (patch)
tree358a79ad601104753b9cbf276a8881d463bedf1f /app/controllers/concerns/feature_checker.rb
parent736d9e51c59d5bcf3966fc059fbe1dd5e2e47c69 (diff)
downloadchouette-core-3305dca57e2e0a46b583f183040a82819ffd6efb.tar.bz2
Improve styles in FeatureCheck code. Refs #5339
Diffstat (limited to 'app/controllers/concerns/feature_checker.rb')
-rw-r--r--app/controllers/concerns/feature_checker.rb5
1 files changed, 3 insertions, 2 deletions
diff --git a/app/controllers/concerns/feature_checker.rb b/app/controllers/concerns/feature_checker.rb
index c23e672cf..9ca5ed0a7 100644
--- a/app/controllers/concerns/feature_checker.rb
+++ b/app/controllers/concerns/feature_checker.rb
@@ -33,8 +33,9 @@ module FeatureChecker
end
def check_feature!(*features)
- authorized = has_feature? *features
- raise NotAuthorizedError, "Feature not autorized" unless authorized
+ unless has_feature?(*features)
+ raise NotAuthorizedError, "Feature not autorized"
+ end
end
class NotAuthorizedError < StandardError; end