Skip to content

Commit fbbb9f2

Browse files
committed
Merge remote-tracking branch 'upstream/master' into sti
2 parents f831526 + c0f9d36 commit fbbb9f2

7 files changed

Lines changed: 73 additions & 55 deletions

File tree

.github/workflows/activerecord.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: activerecord
2+
on: [push]
3+
jobs:
4+
ubuntu:
5+
runs-on: ubuntu-latest
6+
continue-on-error: true
7+
strategy:
8+
matrix:
9+
gemfile: [activerecord_4, activerecord_5, activerecord_6]
10+
ruby: [2.5.7, 2.6.5, 2.7.2]
11+
env:
12+
BUNDLE_GEMFILE: gemfiles/${{ matrix.gemfile }}.gemfile
13+
ADAPTER: active_record
14+
steps:
15+
- uses: actions/checkout@v2
16+
- name: Setup ruby
17+
uses: ruby/setup-ruby@v1
18+
with:
19+
ruby-version: ${{ matrix.ruby }}
20+
- run: sudo apt-get install -y libsqlite3-dev
21+
- run: gem update --system
22+
- run: gem install bundler
23+
- run: gem --version
24+
- run: bundle install
25+
- name: Run Tests
26+
run: |
27+
bundle exec rake

.github/workflows/mongoid.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: mongoid
2+
on: [push]
3+
jobs:
4+
ubuntu:
5+
runs-on: ubuntu-latest
6+
continue-on-error: true
7+
services:
8+
mongodb:
9+
image: mongo:3.4.23
10+
ports:
11+
- 27017:27017
12+
strategy:
13+
matrix:
14+
gemfile: [mongoid_5]
15+
ruby: [2.5.7, 2.6.5, 2.7.2]
16+
env:
17+
BUNDLE_GEMFILE: gemfiles/${{ matrix.gemfile }}.gemfile
18+
ADAPTER: mongoid
19+
steps:
20+
- uses: actions/checkout@v2
21+
- name: Setup ruby
22+
uses: ruby/setup-ruby@v1
23+
with:
24+
ruby-version: ${{ matrix.ruby }}
25+
- run: sudo apt-get install -y libsqlite3-dev
26+
- run: gem update --system
27+
- run: gem install bundler
28+
- run: gem --version
29+
- run: bundle install
30+
- name: Run Tests
31+
run: |
32+
bundle exec rake

.travis.yml

Lines changed: 0 additions & 52 deletions
This file was deleted.

CHANGELOG.rdoc

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
= 6.0.0 (April 2, 2021)
2+
3+
Breaking changes:
4+
5+
* Support strict <tt>with_role</tt> queries. Note this changes behaviour of with_role when running in strict mode to behave as previously documented. #543 describes the behaviour change.
6+
* Dropped support for Ruby 2.3 and 2.4
7+
8+
Improvements:
9+
10+
* Updated ActiveRecord adapters implementation of <tt>in</tt> to utilise a subquery instead of two queries
11+
112
= 5.3.0 (June 1, 2020)
213

314
5.3.0 will be the last version to support Ruby < 2.5 and Rails < 5.2. Support for these will be dropped in the next major release.

Rakefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ RSpec::Core::RakeTask.new(:rolify) do |task|
1515
task.pattern = 'spec/rolify/**/*_spec.rb'
1616
end
1717

18-
if !ENV["APPRAISAL_INITIALIZED"] && !ENV["TRAVIS"]
18+
if !ENV["APPRAISAL_INITIALIZED"] && !ENV["CI"]
1919
task :default => :appraisal
2020
else
2121
task :default => [ :spec, 'coveralls:push' ]

lib/rolify/adapters/active_record/resource_adapter.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ def resources_find(roles_table, relation, role_name)
2626
end
2727

2828
def in(relation, user, role_names)
29-
roles = user.roles.where(:name => role_names).select("#{quote_table(role_class.table_name)}.#{quote_column(role_class.primary_key)}").to_a
29+
roles = user.roles.where(:name => role_names).select("#{quote_table(role_class.table_name)}.#{quote_column(role_class.primary_key)}")
3030
relation.where("#{quote_table(role_class.table_name)}.#{quote_column(role_class.primary_key)} IN (?) AND ((#{quote_table(role_class.table_name)}.resource_id = #{quote_table(relation.table_name)}.#{quote_column(relation.primary_key)}) OR (#{quote_table(role_class.table_name)}.resource_id IS NULL))", roles)
3131
end
3232

lib/rolify/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
module Rolify
2-
VERSION = "5.3.0"
2+
VERSION = "6.0.0"
33
end

0 commit comments

Comments
 (0)