From 2f68c154f0fdd8144b150a3ee6d63be181c81a70 Mon Sep 17 00:00:00 2001 From: Duncan Stuart Date: Wed, 21 Aug 2019 17:27:50 +0200 Subject: [PATCH] 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. --- .rubocop.yml | 3 --- lib/pundit.rb | 6 +++--- lib/pundit/policy_finder.rb | 2 +- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/.rubocop.yml b/.rubocop.yml index 1074f12..c1126d8 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -37,9 +37,6 @@ Layout/CaseIndentation: - end IndentOneStep: true -Layout/AccessModifierIndentation: - EnforcedStyle: outdent - Layout/EndAlignment: EnforcedStyleAlignWith: variable diff --git a/lib/pundit.rb b/lib/pundit.rb index 9109aa0..c3a1d1d 100644 --- a/lib/pundit.rb +++ b/lib/pundit.rb @@ -144,7 +144,7 @@ module Pundit raise InvalidConstructorError, "Invalid #<#{policy}> constructor is called" end - private + private def pundit_model(record) record.is_a?(Array) ? record.last : record @@ -167,7 +167,7 @@ module Pundit end end -protected + protected # @return [Boolean] whether authorization has been performed, i.e. whether # one {#authorize} or {#skip_authorization} has been called @@ -317,7 +317,7 @@ protected current_user end -private + private def pundit_policy_scope(scope) policy_scopes[scope] ||= Pundit.policy_scope!(pundit_user, scope) diff --git a/lib/pundit/policy_finder.rb b/lib/pundit/policy_finder.rb index df072d9..40467d9 100644 --- a/lib/pundit/policy_finder.rb +++ b/lib/pundit/policy_finder.rb @@ -68,7 +68,7 @@ module Pundit end end - private + private def find(subject) if subject.is_a?(Array)