Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest]
ruby: ["2.6", "2.7", "3.0"]
ruby: ["2.7", "3.0", "3.1", "3.2"]
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ruby 2.6 tests were failing due to an incompatibility with ActiveSupport 6.1. Plus, its EOL was in 2022 so I figured we're safe to stop supporting it.

runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
Expand Down
2 changes: 1 addition & 1 deletion accessly.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Gem::Specification.new do |spec|
spec.add_development_dependency "bundler", "~> 2.1"
spec.add_development_dependency "rake", "~> 13.0"
spec.add_development_dependency "minitest", "~> 5.0"
spec.add_development_dependency "database_cleaner", "~> 1.8"
spec.add_development_dependency "database_cleaner", "~> 2.0"
spec.add_development_dependency "pg", "~> 1.0"
spec.add_development_dependency "rails", ">= 5.0"
end
6 changes: 3 additions & 3 deletions lib/accessly/permission/grant.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ class Grant < Accessly::Base
# @param actor [ActiveRecord::Base] The actor to grant permission
def initialize(actor)
super(actor)
@actor = case actor
when ActiveRecord::Base
actor

if actor.is_a?(ActiveRecord::Base)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style/GuardClause: Use a guard clause instead of wrapping the code inside a conditional expression.

@actor = actor
else
raise Accessly::GrantError.new("Actor is not an ActiveRecord::Base object")
end
Expand Down