1
0
Fork 0
mirror of https://github.com/varvet/pundit.git synced 2022-11-09 12:30:11 -05:00

Remove rubocop rule around access modifiers

The fewer exceptions to the default the better, and we're going to want
to use an access modifier in a generator, which will end up in other
people's codebases, so we should be as conventional as possible.
This commit is contained in:
Duncan Stuart 2019-08-21 17:27:50 +02:00
parent f11a066250
commit 2f68c154f0
3 changed files with 4 additions and 7 deletions

View file

@ -37,9 +37,6 @@ Layout/CaseIndentation:
- end - end
IndentOneStep: true IndentOneStep: true
Layout/AccessModifierIndentation:
EnforcedStyle: outdent
Layout/EndAlignment: Layout/EndAlignment:
EnforcedStyleAlignWith: variable EnforcedStyleAlignWith: variable

View file

@ -144,7 +144,7 @@ module Pundit
raise InvalidConstructorError, "Invalid #<#{policy}> constructor is called" raise InvalidConstructorError, "Invalid #<#{policy}> constructor is called"
end end
private private
def pundit_model(record) def pundit_model(record)
record.is_a?(Array) ? record.last : record record.is_a?(Array) ? record.last : record
@ -167,7 +167,7 @@ module Pundit
end end
end end
protected protected
# @return [Boolean] whether authorization has been performed, i.e. whether # @return [Boolean] whether authorization has been performed, i.e. whether
# one {#authorize} or {#skip_authorization} has been called # one {#authorize} or {#skip_authorization} has been called
@ -317,7 +317,7 @@ protected
current_user current_user
end end
private private
def pundit_policy_scope(scope) def pundit_policy_scope(scope)
policy_scopes[scope] ||= Pundit.policy_scope!(pundit_user, scope) policy_scopes[scope] ||= Pundit.policy_scope!(pundit_user, scope)

View file

@ -68,7 +68,7 @@ module Pundit
end end
end end
private private
def find(subject) def find(subject)
if subject.is_a?(Array) if subject.is_a?(Array)