Skip to content

Commit

Permalink
Do not use shorthand hash syntax because jruby
Browse files Browse the repository at this point in the history
JRuby targets 2.6, and doesn't support this syntax. JRuby 9.3 is still supported: https://github.com/jruby/jruby/wiki/Roadmap

When JRuby 9.3 isn't supported any more, we can drop it.
  • Loading branch information
Burgestrand committed Mar 7, 2024
1 parent 9a3e636 commit 3982ac3
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 3 deletions.
3 changes: 3 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,3 +73,6 @@ Style/DoubleNegation:

Style/Documentation:
Enabled: false # TODO: Enable again once we have more docs

Style/HashSyntax:
EnforcedShorthandSyntax: never
2 changes: 1 addition & 1 deletion lib/pundit/authorization.rb
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def authorize(record, query = nil, policy_class: nil)

@_pundit_policy_authorized = true

Pundit.authorize(pundit_user, record, query, policy_class:, cache: policies)
Pundit.authorize(pundit_user, record, query, policy_class: policy_class, cache: policies)
end

# Allow this action not to perform authorization.
Expand Down
2 changes: 1 addition & 1 deletion lib/pundit/rspec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def permissions

module DSL
def permissions(*list, &block)
describe(list.to_sentence, permissions: list, caller:) { instance_eval(&block) }
describe(list.to_sentence, permissions: list, caller: caller) { instance_eval(&block) }
end
end

Expand Down
2 changes: 1 addition & 1 deletion spec/policies/post_policy_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

RSpec.describe PostPolicy do
let(:user) { double }
let(:own_post) { double(user:) }
let(:own_post) { double(user: user) }
let(:other_post) { double(user: double) }
subject { described_class }

Expand Down

0 comments on commit 3982ac3

Please sign in to comment.