Skip to content

Commit f831526

Browse files
committed
Merge remote-tracking branch 'upstream/master' into sti
2 parents 98925eb + 7c144ad commit f831526

23 files changed

Lines changed: 241 additions & 122 deletions

‎.hakiri.yml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
dependency_source: gemspec_file

‎.travis.yml‎

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,19 @@ after_success:
1111
- bundle exec codeclimate-test-reporter
1212

1313
rvm:
14+
- 2.7.0
1415
- 2.6.3
1516
- 2.5.5
16-
- 2.4.6
17-
- 2.3.8
1817

1918
gemfile:
2019
- gemfiles/activerecord_4.gemfile
2120
- gemfiles/activerecord_5.gemfile
21+
- gemfiles/activerecord_6.gemfile
22+
- gemfiles/mongoid_5.gemfile
2223
- gemfiles/mongoid_6.gemfile
2324
- gemfiles/mongoid_7.gemfile
2425

25-
env:
26+
env:
2627
- ADAPTER=active_record
2728
- ADAPTER=mongoid
2829

@@ -32,12 +33,17 @@ matrix:
3233
env: ADAPTER=mongoid
3334
- gemfile: gemfiles/activerecord_5.gemfile
3435
env: ADAPTER=mongoid
36+
- gemfile: gemfiles/activerecord_6.gemfile
37+
env: ADAPTER=mongoid
38+
- gemfile: gemfiles/mongoid_5.gemfile
39+
env: ADAPTER=active_record
3540
- gemfile: gemfiles/mongoid_6.gemfile
3641
env: ADAPTER=active_record
3742
- gemfile: gemfiles/mongoid_7.gemfile
3843
env: ADAPTER=active_record
3944
allow_failures:
40-
- env: ADAPTER=mongoid
45+
- gemfile: gemfiles/mongoid_6.gemfile
46+
- gemfile: gemfiles/mongoid_7.gemfile
4147

4248
services: mongodb
4349

‎Appraisals‎

Lines changed: 25 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,42 @@
1+
appraise 'mongoid-5' do
2+
gem "mongoid", "~> 5"
3+
gem "bson_ext", "1.5.1"
4+
gem 'bigdecimal', '1.4.2'
5+
end
6+
17
appraise 'mongoid-6' do
28
gem "mongoid", "~> 6"
3-
gem "bson_ext", :platform => "ruby"
9+
gem "bson_ext", "1.5.1"
410
end
511

612
appraise 'mongoid-7' do
713
gem "mongoid", "~> 7"
8-
gem "bson_ext", :platform => "ruby"
14+
gem "bson_ext", "1.5.1"
15+
gem "railties", "5.2.4.1"
916
end
1017

1118
appraise 'activerecord-4' do
12-
gem "sqlite3", "~> 1.3.6", :platform => "ruby"
19+
gem "sqlite3", "~> 1.3.6"
1320
gem "activerecord", "~> 4.2.11", :require => "active_record"
21+
gem 'bigdecimal', '1.4.2'
1422
end
1523

1624
appraise 'activerecord-5' do
17-
gem "sqlite3", "~> 1.3.6", :platform => "ruby"
18-
gem "activerecord", ">= 5.2.0", :require => "active_record"
25+
gem "sqlite3", "~> 1.3.6"
26+
gem "activerecord", "~> 5.2.4", :require => "active_record"
1927

2028
# Ammeter dependencies:
21-
gem "actionpack", ">= 5.2.0"
22-
gem "activemodel", ">= 5.2.0"
23-
gem "railties", ">= 5.2.0"
29+
gem "actionpack", "~> 5.2.4"
30+
gem "activemodel", "~> 5.2.4"
31+
gem "railties", "~> 5.2.4"
32+
end
2433

25-
gem 'rspec-rails' , github: 'rspec/rspec-rails'
26-
gem 'rspec-core' , github: 'rspec/rspec-core'
27-
gem 'rspec-expectations', github: 'rspec/rspec-expectations'
28-
gem 'rspec-mocks' , github: 'rspec/rspec-mocks'
29-
gem 'rspec-support' , github: 'rspec/rspec-support'
34+
appraise 'activerecord-6' do
35+
gem "sqlite3", "~> 1.4", :platform => "ruby"
36+
gem "activerecord", ">= 6.0.0", :require => "active_record"
37+
38+
# Ammeter dependencies:
39+
gem "actionpack", ">= 6.0.0"
40+
gem "activemodel", ">= 6.0.0"
41+
gem "railties", ">= 6.0.0"
3042
end

‎CHANGELOG.rdoc‎

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
= 5.3.0 (June 1, 2020)
2+
3+
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.
4+
5+
* Fix deprecation warning in Ruby 2.7
6+
* Add Rails 6 support to migration generator
7+
* Significant ActiveRecord performance improvements to <tt>add_role</tt> and <tt>without_role</tt>
8+
* Mongoid fix and performance improvement and to <tt>roles_name</tt>
9+
* Make it safe to call <tt>Thing.with_role(:admin, user)</tt> with new record
10+
111
= 5.2.0 (Dec 14, 2017)
212
* Fix regression in generator around belongs_to options compatibility
313
* Update version of database_cleaner
@@ -126,7 +136,7 @@
126136
* fixed a backward incompatible change introduced in Rails 3.2 release (<tt>find_or_create_by_* generated methods</tt>)
127137

128138
= 2.2 (Jan 18, 2012)
129-
* fixed a bug in the initializer file regarding dynamic shortcuts
139+
* fixed a bug in the initializer file regarding dynamic shortcuts
130140

131141
= 2.1 (Nov 30, 2011)
132142
* added syntactic sugar: <tt>grant</tt> and <tt>revoke</tt> are aliases for <tt>has_role</tt> and <tt>has_no_role</tt>
@@ -167,8 +177,8 @@
167177

168178
= 1.0 (Aug 25, 2011)
169179
* added a new parameter to disable dynamic shortcut methods due to potential incompatibility with other gems using method_missing with the same pattern
170-
* add <tt>Rolify.dynamic_shortcuts = false</tt> in the initializer file or
171-
* use the generator command with a third parameter:
180+
* add <tt>Rolify.dynamic_shortcuts = false</tt> in the initializer file or
181+
* use the generator command with a third parameter:
172182
* <tt>rails g rolify:role Role User false</tt>
173183
* removed the railtie as it created more problems than it solved
174184
* code refactoring to do some speed improvements and code clean up
@@ -177,16 +187,16 @@
177187
* rolify is now on travis-ci to monitor build status
178188

179189
= 0.7 (June 20, 2011)
180-
* added a method_missing to catch newly created role outside the current ruby process (i.e. dynamic shortcut methods are not defined within this process)
181-
* dynamic shortcut is created on the fly in the method_missing to avoid extra method_missing for the same dynamic shortcut
182-
* check if the role actually exists in the database before defining the new method
190+
* added a method_missing to catch newly created role outside the current ruby process (i.e. dynamic shortcut methods are not defined within this process)
191+
* dynamic shortcut is created on the fly in the method_missing to avoid extra method_missing for the same dynamic shortcut
192+
* check if the role actually exists in the database before defining the new method
183193
* first call is slower due to method_missing but next calls are fast
184194
* avoid strange bugs when spawning many ruby processes as the dynamic shortcut methods were only defined in the process that used the <tt>has_role</tt> command
185195

186196
= 0.6 (June 19, 2011)
187197
* custom User and Role class names support
188198
* can now use other class names for Role and User classes
189-
* fixed generators and templates
199+
* fixed generators and templates
190200
* join table is explicitly set to avoid alphabetical order issue
191201
* created a new railtie to load the dynamic shortcuts at startup
192202

@@ -208,7 +218,7 @@
208218
* Trying to remove a role scoped to a resource whereas the user has a global role won't remove it
209219

210220
= v0.3 (June 06, 2011)
211-
* multiple roles check:
221+
* multiple roles check:
212222
* <tt>has_all_roles?</tt> returns true if the user has ALL the roles in arguments
213223
* <tt>has_any_role?</tt> returns true if the user has ANY the roles in arguments
214224

‎Gemfile‎

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
source "https://rubygems.org"
22

33
group :test do
4-
gem 'appraisal'
5-
gem 'coveralls', :require => false
4+
gem 'codeclimate-test-reporter', require: nil
5+
gem 'coveralls', require: false
6+
gem 'database_cleaner', '~> 1.6.2'
67
gem 'its'
8+
gem 'test-unit' # Implicitly loaded by ammeter
9+
710
gem 'byebug'
11+
gem 'pry'
812
gem 'pry-byebug'
9-
gem 'test-unit' # Implicitly loaded by ammeter
10-
gem 'database_cleaner', '~> 1.6.2'
11-
gem 'codeclimate-test-reporter', :require => nil
1213
end
1314

1415
gemspec

‎README.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# rolify [![Gem Version](https://badge.fury.io/rb/rolify.svg)](http://badge.fury.io/rb/rolify) [![build status](https://secure.travis-ci.org/RolifyCommunity/rolify.png)](http://travis-ci.org/RolifyCommunity/rolify) [![Code Climate](https://codeclimate.com/github/RolifyCommunity/rolify.png)](https://codeclimate.com/github/RolifyCommunity/rolify) [![Coverage Status](https://coveralls.io/repos/RolifyCommunity/rolify/badge.svg?branch=master&service=github)](https://coveralls.io/github/RolifyCommunity/rolify?branch=master)
1+
# rolify [![Gem Version](https://badge.fury.io/rb/rolify.svg)](http://badge.fury.io/rb/rolify) [![build status](https://travis-ci.org/RolifyCommunity/rolify.svg)](http://travis-ci.org/RolifyCommunity/rolify) [![Code Climate](https://codeclimate.com/github/RolifyCommunity/rolify.svg)](https://codeclimate.com/github/RolifyCommunity/rolify) [![Coverage Status](https://coveralls.io/repos/RolifyCommunity/rolify/badge.svg?branch=master&service=github)](https://coveralls.io/github/RolifyCommunity/rolify?branch=master)
22

33
Very simple Roles library without any authorization enforcement supporting scope on resource object.
44

@@ -46,7 +46,7 @@ rails g rolify Role User
4646
rails g rolify:role Role User
4747
```
4848

49-
The generator will create your Role model, add a migration file, and update your User class with new class methods.
49+
The generator will create your Role model, add a migration file, and update your User class with new class methods.
5050

5151
### 2. Run the migration (only required when using ActiveRecord)
5252

‎gemfiles/activerecord_4.gemfile‎

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,19 @@
22

33
source "https://rubygems.org"
44

5-
gem "sqlite3", "~> 1.3.6", platform: "ruby"
5+
gem "sqlite3", "~> 1.3.6"
66
gem "activerecord", "~> 4.2.11", require: "active_record"
7+
gem "bigdecimal", "1.4.2"
78

89
group :test do
9-
gem "appraisal"
10+
gem "codeclimate-test-reporter", require: nil
1011
gem "coveralls", require: false
12+
gem "database_cleaner", "~> 1.6.2"
1113
gem "its"
14+
gem "test-unit"
1215
gem "byebug"
16+
gem "pry"
1317
gem "pry-byebug"
14-
gem "test-unit"
15-
gem "database_cleaner", "~> 1.6.2"
16-
gem "codeclimate-test-reporter", require: nil
1718
end
1819

1920
gemspec path: "../"

‎gemfiles/activerecord_5.gemfile‎

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,26 +2,21 @@
22

33
source "https://rubygems.org"
44

5-
gem "sqlite3", "~> 1.3.6", platform: "ruby"
6-
gem "activerecord", ">= 5.2.0", require: "active_record"
7-
gem "actionpack", ">= 5.2.0"
8-
gem "activemodel", ">= 5.2.0"
9-
gem "railties", ">= 5.2.0"
10-
gem "rspec-rails", github: "rspec/rspec-rails"
11-
gem "rspec-core", github: "rspec/rspec-core"
12-
gem "rspec-expectations", github: "rspec/rspec-expectations"
13-
gem "rspec-mocks", github: "rspec/rspec-mocks"
14-
gem "rspec-support", github: "rspec/rspec-support"
5+
gem "sqlite3", "~> 1.3.6"
6+
gem "activerecord", "~> 5.2.4", require: "active_record"
7+
gem "actionpack", "~> 5.2.4"
8+
gem "activemodel", "~> 5.2.4"
9+
gem "railties", "~> 5.2.4"
1510

1611
group :test do
17-
gem "appraisal"
12+
gem "codeclimate-test-reporter", require: nil
1813
gem "coveralls", require: false
14+
gem "database_cleaner", "~> 1.6.2"
1915
gem "its"
16+
gem "test-unit"
2017
gem "byebug"
18+
gem "pry"
2119
gem "pry-byebug"
22-
gem "test-unit"
23-
gem "database_cleaner", "~> 1.6.2"
24-
gem "codeclimate-test-reporter", require: nil
2520
end
2621

2722
gemspec path: "../"

‎gemfiles/activerecord_6.gemfile‎

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# This file was generated by Appraisal
2+
3+
source "https://rubygems.org"
4+
5+
gem "sqlite3", "~> 1.4", platform: "ruby"
6+
gem "activerecord", ">= 6.0.0", require: "active_record"
7+
gem "actionpack", ">= 6.0.0"
8+
gem "activemodel", ">= 6.0.0"
9+
gem "railties", ">= 6.0.0"
10+
11+
group :test do
12+
gem "codeclimate-test-reporter", require: nil
13+
gem "coveralls", require: false
14+
gem "database_cleaner", "~> 1.6.2"
15+
gem "its"
16+
gem "test-unit"
17+
gem "byebug"
18+
gem "pry"
19+
gem "pry-byebug"
20+
end
21+
22+
gemspec path: "../"

‎gemfiles/mongoid_5.gemfile‎

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# This file was generated by Appraisal
2+
3+
source "https://rubygems.org"
4+
5+
gem "mongoid", "~> 5"
6+
gem "bson_ext", "1.5.1"
7+
gem "bigdecimal", "1.4.2"
8+
9+
group :test do
10+
gem "codeclimate-test-reporter", require: nil
11+
gem "coveralls", require: false
12+
gem "database_cleaner", "~> 1.6.2"
13+
gem "its"
14+
gem "test-unit"
15+
gem "byebug"
16+
gem "pry"
17+
gem "pry-byebug"
18+
end
19+
20+
gemspec path: "../"

0 commit comments

Comments
 (0)