diff options
author | http://jneen.net/ <jneen@jneen.net> | 2017-08-01 11:58:44 -0700 |
---|---|---|
committer | http://jneen.net/ <jneen@jneen.net> | 2017-08-03 09:07:18 -0700 |
commit | 4dfda5f2662afe32fcaa95b851fe6bdff9e20c08 (patch) | |
tree | c2af1aafc2794755683d82bf06d5fc828b55b5be | |
parent | 0487009d3707c8180211bfc4b3c5a8a9daec50b8 (diff) | |
download | gitlab-ce-4dfda5f2662afe32fcaa95b851fe6bdff9e20c08.tar.gz |
declarative_policy rubocop fix
-rw-r--r-- | lib/declarative_policy.rb | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/declarative_policy.rb b/lib/declarative_policy.rb index 4936669a73a..ae65653645b 100644 --- a/lib/declarative_policy.rb +++ b/lib/declarative_policy.rb @@ -28,8 +28,9 @@ module DeclarativePolicy subject = find_delegate(subject) - class_for_class(subject.class) \ - or raise "no policy for #{subject.class.name}" + policy_class = class_for_class(subject.class) + raise "no policy for #{subject.class.name}" if policy_class.nil? + policy_class end def has_policy?(subject) |