Skip to content

Commit e10c3c9

Browse files
committed
Merge branch 'release/3.0.0'
2 parents 1760baa + 7e24de1 commit e10c3c9

File tree

71 files changed

+1972
-933
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

71 files changed

+1972
-933
lines changed

.rubocop.yml

+2-8
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@ Style/Documentation:
44
Style/NonNilCheck:
55
IncludeSemanticChanges: true
66

7-
Style/FrozenStringLiteralComment:
8-
Enabled: false
9-
107
Style/EmptyMethod:
118
Enabled: false
129

@@ -27,7 +24,7 @@ Metrics/BlockLength:
2724
# NamePrefix: is_, has_, have_
2825
# NamePrefixBlacklist: is_, has_, have_
2926
# NameWhitelist: is_a?
30-
Style/PredicateName:
27+
Naming/PredicateName:
3128
Exclude:
3229
- 'spec/**/*'
3330
- 'lib/cancan/ability.rb'
@@ -36,11 +33,8 @@ Style/PredicateName:
3633
Lint/AmbiguousBlockAssociation:
3734
Enabled: false
3835

39-
4036
AllCops:
4137
TargetRubyVersion: 2.2.0
4238
Exclude:
43-
- 'gemfiles/vendor/bundle/**/*'
39+
- 'gemfiles/**/*'
4440
- 'Appraisals'
45-
46-
inherit_from: .rubocop_todo.yml

.rubocop_todo.yml

Whitespace-only changes.

.travis.yml

+33-18
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,49 @@
11
language: ruby
22
cache: bundler
33
sudo: false
4+
addons:
5+
postgresql: "9.6"
46
rvm:
57
- 2.3.5
68
- 2.4.2
7-
- 2.5.0
89
- 2.5.1
9-
- jruby-9.0.5.0
10+
- 2.6.0
11+
- ruby-head
1012
- jruby-9.1.9.0
13+
- jruby-9.2.5.0
14+
- jruby-head
15+
1116
gemfile:
12-
- gemfiles/activerecord_4.2.gemfile
17+
- gemfiles/activerecord_4.2.0.gemfile
1318
- gemfiles/activerecord_5.0.2.gemfile
1419
- gemfiles/activerecord_5.1.0.gemfile
15-
- gemfiles/activerecord_5.2.0.gemfile
16-
services:
17-
- mongodb
20+
- gemfiles/activerecord_5.2.2.gemfile
21+
- gemfiles/activerecord_6.0.0.gemfile
22+
env:
23+
- DB=sqlite
24+
- DB=postgres
25+
1826
matrix:
1927
fast_finish: true
2028
exclude:
21-
- rvm: jruby-9.0.5.0
22-
gemfile: gemfiles/activerecord_5.0.2.gemfile
23-
- rvm: jruby-9.1.9.0
24-
gemfile: gemfiles/activerecord_5.0.2.gemfile
25-
- rvm: jruby-9.0.5.0
26-
gemfile: gemfiles/activerecord_5.1.0.gemfile
27-
- rvm: jruby-9.1.9.0
28-
gemfile: gemfiles/activerecord_5.1.0.gemfile
29-
- rvm: jruby-9.0.5.0
30-
gemfile: gemfiles/activerecord_5.2.0.gemfile
31-
- rvm: jruby-9.1.9.0
32-
gemfile: gemfiles/activerecord_5.2.0.gemfile
29+
- rvm: 2.2.6
30+
gemfile: gemfiles/activerecord_6.0.0.gemfile
31+
- rvm: 2.3.5
32+
gemfile: gemfiles/activerecord_6.0.0.gemfile
33+
- rvm: 2.4.2
34+
gemfile: gemfiles/activerecord_6.0.0.gemfile
35+
- rvm: jruby-9.1.9.0
36+
gemfile: gemfiles/activerecord_5.0.2.gemfile
37+
- rvm: jruby-9.1.9.0
38+
gemfile: gemfiles/activerecord_6.0.0.gemfile
39+
- rvm: jruby-9.2.5.0
40+
gemfile: gemfiles/activerecord_5.0.2.gemfile
41+
- rvm: jruby-9.2.5.0
42+
gemfile: gemfiles/activerecord_6.0.0.gemfile
43+
allow_failures:
44+
- rvm: ruby-head
45+
- rvm: jruby-head
46+
3347
notifications:
3448
email:
3549
recipients:
@@ -38,5 +52,6 @@ notifications:
3852
on_failure: change
3953
before_install:
4054
- gem update --system
55+
- gem install bundler
4156
script:
4257
- bundle exec rubocop && bundle exec rake

Appraisals

+30-9
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
appraise 'activerecord_4.2' do
1+
appraise 'activerecord_4.2.0' do
22
gem 'activerecord', '~> 4.2.0', require: 'active_record'
33
gem 'activesupport', '~> 4.2.0', require: 'active_support/all'
44
gem 'actionpack', '~> 4.2.0', require: 'action_pack'
@@ -7,10 +7,11 @@ appraise 'activerecord_4.2' do
77
gemfile.platforms :jruby do
88
gem 'activerecord-jdbcsqlite3-adapter', '~> 1.3.24'
99
gem 'jdbc-sqlite3'
10+
gem 'jdbc-postgres'
1011
end
1112

1213
gemfile.platforms :ruby, :mswin, :mingw do
13-
gem 'sqlite3'
14+
gem 'sqlite3', '~> 1.3.0'
1415
gem 'pg', '~> 0.21'
1516
end
1617
end
@@ -23,10 +24,11 @@ appraise 'activerecord_5.0.2' do
2324
gemfile.platforms :jruby do
2425
gem 'activerecord-jdbcsqlite3-adapter'
2526
gem 'jdbc-sqlite3'
27+
gem 'jdbc-postgres'
2628
end
2729

2830
gemfile.platforms :ruby, :mswin, :mingw do
29-
gem 'sqlite3'
31+
gem 'sqlite3', '~> 1.3.0'
3032
gem 'pg', '~> 0.21'
3133
end
3234
end
@@ -39,26 +41,45 @@ appraise 'activerecord_5.1.0' do
3941
gemfile.platforms :jruby do
4042
gem 'activerecord-jdbcsqlite3-adapter'
4143
gem 'jdbc-sqlite3'
44+
gem 'jdbc-postgres'
4245
end
4346

4447
gemfile.platforms :ruby, :mswin, :mingw do
45-
gem 'sqlite3'
48+
gem 'sqlite3', '~> 1.3.0'
4649
gem 'pg', '~> 0.21'
4750
end
4851
end
4952

50-
appraise 'activerecord_5.2.0' do
51-
gem 'activerecord', '~> 5.2.0', require: 'active_record'
52-
gem 'activesupport', '~> 5.2.0', require: 'active_support/all'
53-
gem 'actionpack', '~> 5.2.0', require: 'action_pack'
53+
appraise 'activerecord_5.2.2' do
54+
gem 'activerecord', '~> 5.2.2', require: 'active_record'
55+
gem 'activesupport', '~> 5.2.2', require: 'active_support/all'
56+
gem 'actionpack', '~> 5.2.2', require: 'action_pack'
5457

5558
gemfile.platforms :jruby do
5659
gem 'activerecord-jdbcsqlite3-adapter'
5760
gem 'jdbc-sqlite3'
61+
gem 'jdbc-postgres'
5862
end
5963

6064
gemfile.platforms :ruby, :mswin, :mingw do
61-
gem 'sqlite3'
65+
gem 'sqlite3', '~> 1.3.0'
6266
gem 'pg', '~> 0.21'
6367
end
6468
end
69+
70+
appraise 'activerecord_6.0.0' do
71+
gem 'actionpack', '~> 6.0.0.beta3', require: 'action_pack'
72+
gem 'activerecord', '~> 6.0.0.beta3', require: 'active_record'
73+
gem 'activesupport', '~> 6.0.0.beta3', require: 'active_support/all'
74+
75+
platforms :jruby do
76+
gem 'activerecord-jdbcsqlite3-adapter'
77+
gem 'jdbc-sqlite3'
78+
gem 'jdbc-postgres'
79+
end
80+
81+
platforms :ruby, :mswin, :mingw do
82+
gem 'pg', '~> 1.1.4'
83+
gem 'sqlite3', '~> 1.3.0'
84+
end
85+
end

CHANGELOG.md

+24
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,21 @@
1+
## 3.0.0
2+
3+
* [#560](https://github.com/CanCanCommunity/cancancan/pull/560): Add support for Rails 6.0. ([@coorasse][])
4+
* [#489](https://github.com/CanCanCommunity/cancancan/pull/489): Drop support for actions without a subject. ([@andrew-aladev][])
5+
* [#474](https://github.com/CanCanCommunity/cancancan/pull/474): Allow to add attribute-level rules. ([@phaedryx][])
6+
* [#512](https://github.com/CanCanCommunity/cancancan/pull/512): Removed automatic eager loading of associations for ActiveRecord >= 5.0. ([@kaspernj][])
7+
* [#575](https://github.com/CanCanCommunity/cancancan/pull/575): Use the rules compressor when generating joins in accessible_by. ([@coorasse][])
8+
9+
* [#444](https://github.com/CanCanCommunity/cancancan/issues/444): Allow to use symbols when defining conditions over enums. ([@s-mage][])
10+
* [#538](https://github.com/CanCanCommunity/cancancan/issues/538): Merge alias actions when merging abilities. ([@Jcambass][])
11+
* [#462](https://github.com/CanCanCommunity/cancancan/issues/462): Add support to translate the model name in messages. ([@nyamadori][])
12+
* [#567](https://github.com/CanCanCommunity/cancancan/issues/567): Extensively run tests on different databases (sqlite and postgres). ([@coorasse][])
13+
* [#566](https://github.com/CanCanCommunity/cancancan/issues/566): Avoid queries on session dumps (speed up error pages). ([@coorasse][])
14+
* [#568](https://github.com/CanCanCommunity/cancancan/issues/568): Automatically freeze strings in all files. ([@coorasse][])
15+
* [#577](https://github.com/CanCanCommunity/cancancan/pull/577): Normalise rules traversing associations to reduce the number of joins. ([@coorasse][])
16+
17+
Please read the [guide on migrating from CanCanCan 2.x to 3.0](https://github.com/CanCanCommunity/cancancan/wiki/Migrating-from-CanCanCan-2.x-to-3.0)
18+
119
## 2.3.0 (Sep 16th, 2018)
220

321
* [#528](https://github.com/CanCanCommunity/cancancan/issues/528): Compress irrelevant rules before generating a query to optimize performances. ([@coorasse][])
@@ -615,3 +633,9 @@
615633
[@oliverklee]: https://github.com/oliverklee
616634
[@gingray]: https://github.com/gingray
617635
[@timraymond]: https://github.com/timraymond
636+
[@s-mage]: https://github.com/s-mage
637+
[@Jcambass]: https://github.com/Jcambass
638+
[@nyamadori]: https://github.com/nyamadori
639+
[@andrew-aladev]: https://github.com/andrew-aladev
640+
[@phaedryx]: https://github.com/phaedryx
641+
[@kaspernj]: https://github.com/kaspernj

Gemfile

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
source 'https://rubygems.org'
24

35
gemspec

0 commit comments

Comments
 (0)