ransack 2.3.2 → 2.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/FUNDING.yml +3 -0
- data/.github/SECURITY.md +12 -0
- data/.github/workflows/cronjob.yml +102 -0
- data/.github/workflows/rubocop.yml +20 -0
- data/.github/workflows/test.yml +163 -0
- data/.rubocop.yml +44 -0
- data/CHANGELOG.md +28 -1
- data/CONTRIBUTING.md +16 -11
- data/Gemfile +5 -3
- data/README.md +167 -30
- data/bug_report_templates/test-ransack-scope-and-column-same-name.rb +78 -0
- data/bug_report_templates/test-ransacker-arel-present-predicate.rb +71 -0
- data/docs/img/create_release.png +0 -0
- data/docs/release_process.md +17 -0
- data/{polyamorous/lib → lib}/polyamorous/activerecord_5.2_ruby_2/join_association.rb +4 -0
- data/{polyamorous/lib → lib}/polyamorous/activerecord_5.2_ruby_2/join_dependency.rb +0 -0
- data/lib/polyamorous/activerecord_5.2_ruby_2/reflection.rb +11 -0
- data/{polyamorous/lib → lib}/polyamorous/activerecord_6.0_ruby_2/join_association.rb +0 -1
- data/{polyamorous/lib → lib}/polyamorous/activerecord_6.0_ruby_2/join_dependency.rb +0 -1
- data/{polyamorous/lib → lib}/polyamorous/activerecord_6.0_ruby_2/reflection.rb +0 -1
- data/lib/polyamorous/activerecord_6.1_ruby_2/join_association.rb +74 -0
- data/lib/polyamorous/activerecord_6.1_ruby_2/join_dependency.rb +93 -0
- data/{polyamorous/lib → lib}/polyamorous/activerecord_6.1_ruby_2/reflection.rb +0 -1
- data/lib/polyamorous/activerecord_7.0_ruby_2/join_association.rb +1 -0
- data/lib/polyamorous/activerecord_7.0_ruby_2/join_dependency.rb +1 -0
- data/lib/polyamorous/activerecord_7.0_ruby_2/reflection.rb +1 -0
- data/{polyamorous/lib → lib}/polyamorous/join.rb +0 -0
- data/{polyamorous/lib → lib/polyamorous}/polyamorous.rb +1 -1
- data/{polyamorous/lib → lib}/polyamorous/swapping_reflection_class.rb +0 -0
- data/{polyamorous/lib → lib}/polyamorous/tree_node.rb +0 -0
- data/lib/polyamorous.rb +1 -0
- data/lib/ransack/adapters/active_record/base.rb +5 -1
- data/lib/ransack/adapters/active_record/context.rb +55 -13
- data/lib/ransack/adapters/active_record/ransack/constants.rb +1 -1
- data/lib/ransack/adapters/active_record/ransack/context.rb +1 -0
- data/lib/ransack/adapters/active_record/ransack/nodes/condition.rb +11 -3
- data/lib/ransack/configuration.rb +31 -1
- data/lib/ransack/constants.rb +2 -2
- data/lib/ransack/helpers/form_builder.rb +3 -3
- data/lib/ransack/helpers.rb +1 -1
- data/lib/ransack/locale/sv.yml +70 -0
- data/lib/ransack/nodes/attribute.rb +1 -1
- data/lib/ransack/nodes/condition.rb +0 -2
- data/lib/ransack/nodes/grouping.rb +1 -1
- data/lib/ransack/nodes/sort.rb +3 -3
- data/lib/ransack/nodes/value.rb +1 -1
- data/lib/ransack/search.rb +4 -1
- data/lib/ransack/translate.rb +4 -4
- data/lib/ransack/version.rb +1 -1
- data/lib/ransack.rb +2 -2
- data/ransack.gemspec +8 -14
- data/spec/blueprints/articles.rb +1 -1
- data/spec/blueprints/comments.rb +1 -1
- data/spec/blueprints/notes.rb +1 -1
- data/spec/blueprints/tags.rb +1 -1
- data/spec/console.rb +5 -5
- data/spec/helpers/ransack_helper.rb +1 -1
- data/spec/{ransack → polyamorous}/join_association_spec.rb +8 -1
- data/spec/{ransack → polyamorous}/join_dependency_spec.rb +0 -0
- data/spec/{ransack → polyamorous}/join_spec.rb +0 -0
- data/spec/ransack/adapters/active_record/base_spec.rb +26 -15
- data/spec/ransack/adapters/active_record/context_spec.rb +19 -18
- data/spec/ransack/configuration_spec.rb +24 -0
- data/spec/ransack/helpers/form_helper_spec.rb +16 -16
- data/spec/ransack/nodes/condition_spec.rb +13 -0
- data/spec/ransack/nodes/grouping_spec.rb +2 -2
- data/spec/ransack/predicate_spec.rb +1 -1
- data/spec/ransack/search_spec.rb +215 -30
- data/spec/spec_helper.rb +7 -5
- data/spec/support/schema.rb +28 -2
- metadata +45 -47
- data/.travis.yml +0 -47
- data/polyamorous/lib/polyamorous/activerecord_5.2_ruby_2/reflection.rb +0 -12
- data/polyamorous/lib/polyamorous/activerecord_6.1_ruby_2/join_association.rb +0 -2
- data/polyamorous/lib/polyamorous/activerecord_6.1_ruby_2/join_dependency.rb +0 -2
- data/polyamorous/lib/polyamorous/version.rb +0 -3
- data/polyamorous/polyamorous.gemspec +0 -27
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 27d9d0b5ebf5727ab6405767c7b545ae6afc6b6dc1ff6eec441d0108cea8cb11
|
4
|
+
data.tar.gz: b1cd5f875a4c29434efdcaee2a1b47c9ba7fefacba802f6cac0f6c75545cc912
|
5
5
|
SHA512:
|
6
|
-
metadata.gz: '
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '0961ec1b9a3874dfd1242d40bae780b1f5a553e418a7bdcd1e599c5a25768831ce22b12c861a2c703beb2ad157751429aa034de1769ef3c83a8837b27356f679'
|
7
|
+
data.tar.gz: 7483453ea26b635323d153bd632f8c38ef03d24ca674b5266f62a870f29d7e395b81c678ae7403dd6b54b27985203e12c80701a0e990d47dcdeacc6c8b1d5aa6
|
data/.github/FUNDING.yml
ADDED
data/.github/SECURITY.md
ADDED
@@ -0,0 +1,12 @@
|
|
1
|
+
# Security Policy
|
2
|
+
|
3
|
+
## Supported Versions
|
4
|
+
|
5
|
+
At the moment, only the latest major.minor release stream is supported with
|
6
|
+
security updates.
|
7
|
+
|
8
|
+
## Reporting a Vulnerability
|
9
|
+
|
10
|
+
Please use the Tidelift security contact to [report a security
|
11
|
+
vulnerability](https://tidelift.com/security). Tidelift will coordinate the fix
|
12
|
+
and disclosure.
|
@@ -0,0 +1,102 @@
|
|
1
|
+
name: cronjob
|
2
|
+
|
3
|
+
on:
|
4
|
+
schedule:
|
5
|
+
- cron: "0 0 * * *"
|
6
|
+
|
7
|
+
jobs:
|
8
|
+
sqlite3:
|
9
|
+
runs-on: ubuntu-20.04
|
10
|
+
strategy:
|
11
|
+
fail-fast: false
|
12
|
+
matrix:
|
13
|
+
ruby:
|
14
|
+
- 3.0.2
|
15
|
+
- 2.7.4
|
16
|
+
env:
|
17
|
+
DB: sqlite3
|
18
|
+
RAILS: main
|
19
|
+
steps:
|
20
|
+
- uses: actions/checkout@v2
|
21
|
+
- name: Set up Ruby
|
22
|
+
uses: ruby/setup-ruby@v1
|
23
|
+
with:
|
24
|
+
ruby-version: ${{ matrix.ruby }}
|
25
|
+
- name: Install dependencies
|
26
|
+
run: bundle install
|
27
|
+
- name: Run tests
|
28
|
+
run: bundle exec rspec
|
29
|
+
|
30
|
+
mysql:
|
31
|
+
runs-on: ubuntu-20.04
|
32
|
+
strategy:
|
33
|
+
fail-fast: false
|
34
|
+
matrix:
|
35
|
+
ruby:
|
36
|
+
- 3.0.2
|
37
|
+
- 2.7.4
|
38
|
+
env:
|
39
|
+
DB: mysql
|
40
|
+
RAILS: main
|
41
|
+
MYSQL_USERNAME: root
|
42
|
+
MYSQL_PASSWORD: root
|
43
|
+
steps:
|
44
|
+
- uses: actions/checkout@v2
|
45
|
+
- name: Set up Ruby
|
46
|
+
uses: ruby/setup-ruby@v1
|
47
|
+
with:
|
48
|
+
ruby-version: ${{ matrix.ruby }}
|
49
|
+
- name: Startup MySQL
|
50
|
+
run: |
|
51
|
+
sudo systemctl start mysql.service
|
52
|
+
- name: Setup databases
|
53
|
+
run: |
|
54
|
+
mysql --user=root --password=root --host=127.0.0.1 -e 'create database ransack collate utf8_general_ci;';
|
55
|
+
mysql --user=root --password=root --host=127.0.0.1 -e 'use ransack;show variables like "%character%";show variables like "%collation%";';
|
56
|
+
- name: Install dependencies
|
57
|
+
run: bundle install
|
58
|
+
- name: Run tests
|
59
|
+
run: bundle exec rspec
|
60
|
+
|
61
|
+
postgres:
|
62
|
+
runs-on: ubuntu-20.04
|
63
|
+
strategy:
|
64
|
+
fail-fast: false
|
65
|
+
matrix:
|
66
|
+
ruby:
|
67
|
+
- 3.0.2
|
68
|
+
- 2.7.4
|
69
|
+
env:
|
70
|
+
DB: postgres
|
71
|
+
RAILS: main
|
72
|
+
DATABASE_USERNAME: postgres
|
73
|
+
DATABASE_PASSWORD: postgres
|
74
|
+
DATABASE_HOST: 127.0.0.1
|
75
|
+
services:
|
76
|
+
postgres:
|
77
|
+
image: postgres
|
78
|
+
ports:
|
79
|
+
- 5432:5432
|
80
|
+
env:
|
81
|
+
POSTGRES_PASSWORD: postgres
|
82
|
+
POSTGRES_HOST_AUTH_METHOD: trust
|
83
|
+
# Set health checks to wait until postgres has started
|
84
|
+
options: >-
|
85
|
+
--health-cmd pg_isready
|
86
|
+
--health-interval 10s
|
87
|
+
--health-timeout 5s
|
88
|
+
--health-retries 5
|
89
|
+
|
90
|
+
steps:
|
91
|
+
- uses: actions/checkout@v2
|
92
|
+
- name: Set up Ruby
|
93
|
+
uses: ruby/setup-ruby@v1
|
94
|
+
with:
|
95
|
+
ruby-version: ${{ matrix.ruby }}
|
96
|
+
- name: Setup databases
|
97
|
+
run: |
|
98
|
+
psql -h localhost -p 5432 -W postgres -c 'create database ransack;' -U postgres;
|
99
|
+
- name: Install dependencies
|
100
|
+
run: bundle install
|
101
|
+
- name: Run tests
|
102
|
+
run: bundle exec rspec
|
@@ -0,0 +1,20 @@
|
|
1
|
+
name: rubocop
|
2
|
+
|
3
|
+
on:
|
4
|
+
push:
|
5
|
+
pull_request:
|
6
|
+
|
7
|
+
jobs:
|
8
|
+
build:
|
9
|
+
runs-on: ubuntu-20.04
|
10
|
+
|
11
|
+
steps:
|
12
|
+
- uses: actions/checkout@v2
|
13
|
+
- name: Set up Ruby
|
14
|
+
uses: ruby/setup-ruby@v1
|
15
|
+
with:
|
16
|
+
ruby-version: 3.0.1
|
17
|
+
- name: Install gems
|
18
|
+
run: bundle install --jobs 4 --retry 3
|
19
|
+
- name: Run RuboCop
|
20
|
+
run: bundle exec rubocop --parallel
|
@@ -0,0 +1,163 @@
|
|
1
|
+
name: test
|
2
|
+
|
3
|
+
on:
|
4
|
+
push:
|
5
|
+
pull_request:
|
6
|
+
|
7
|
+
jobs:
|
8
|
+
sqlite3:
|
9
|
+
runs-on: ubuntu-20.04
|
10
|
+
strategy:
|
11
|
+
fail-fast: false
|
12
|
+
matrix:
|
13
|
+
rails:
|
14
|
+
- v7.0.0
|
15
|
+
- v6.1.4
|
16
|
+
- v6.0.4
|
17
|
+
- 6-0-stable
|
18
|
+
- 5-2-stable
|
19
|
+
- v5.2.4
|
20
|
+
ruby:
|
21
|
+
- 3.0.2
|
22
|
+
- 2.7.4
|
23
|
+
- 2.6.7
|
24
|
+
exclude:
|
25
|
+
- rails: v7.0.0
|
26
|
+
ruby: 2.6.7
|
27
|
+
- rails: v5.2.4
|
28
|
+
ruby: 3.0.2
|
29
|
+
- rails: 5-2-stable
|
30
|
+
ruby: 3.0.2
|
31
|
+
env:
|
32
|
+
DB: sqlite3
|
33
|
+
RAILS: ${{ matrix.rails }}
|
34
|
+
steps:
|
35
|
+
- uses: actions/checkout@v2
|
36
|
+
- name: Set up Ruby
|
37
|
+
uses: ruby/setup-ruby@v1
|
38
|
+
with:
|
39
|
+
ruby-version: ${{ matrix.ruby }}
|
40
|
+
- name: Install dependencies
|
41
|
+
run: bundle install
|
42
|
+
- name: Run tests
|
43
|
+
run: bundle exec rspec
|
44
|
+
|
45
|
+
mysql:
|
46
|
+
runs-on: ubuntu-20.04
|
47
|
+
strategy:
|
48
|
+
fail-fast: false
|
49
|
+
matrix:
|
50
|
+
rails:
|
51
|
+
- v7.0.0
|
52
|
+
- v6.1.4
|
53
|
+
- v6.0.4
|
54
|
+
- 6-0-stable
|
55
|
+
- 5-2-stable
|
56
|
+
- v5.2.4
|
57
|
+
ruby:
|
58
|
+
- 3.0.2
|
59
|
+
- 2.7.4
|
60
|
+
- 2.6.7
|
61
|
+
exclude:
|
62
|
+
- rails: v7.0.0
|
63
|
+
ruby: 2.6.7
|
64
|
+
- rails: v5.2.4
|
65
|
+
ruby: 3.0.2
|
66
|
+
- rails: 5-2-stable
|
67
|
+
ruby: 3.0.2
|
68
|
+
env:
|
69
|
+
DB: mysql
|
70
|
+
RAILS: ${{ matrix.rails }}
|
71
|
+
MYSQL_USERNAME: root
|
72
|
+
MYSQL_PASSWORD: root
|
73
|
+
steps:
|
74
|
+
- uses: actions/checkout@v2
|
75
|
+
- name: Set up Ruby
|
76
|
+
uses: ruby/setup-ruby@v1
|
77
|
+
with:
|
78
|
+
ruby-version: ${{ matrix.ruby }}
|
79
|
+
- name: Startup MySQL
|
80
|
+
run: |
|
81
|
+
sudo systemctl start mysql.service
|
82
|
+
- name: Setup databases
|
83
|
+
run: |
|
84
|
+
mysql --user=root --password=root --host=127.0.0.1 -e 'create database ransack collate utf8_general_ci;';
|
85
|
+
mysql --user=root --password=root --host=127.0.0.1 -e 'use ransack;show variables like "%character%";show variables like "%collation%";';
|
86
|
+
- name: Install dependencies
|
87
|
+
run: bundle install
|
88
|
+
- name: Run tests
|
89
|
+
run: bundle exec rspec
|
90
|
+
|
91
|
+
postgres:
|
92
|
+
runs-on: ubuntu-20.04
|
93
|
+
strategy:
|
94
|
+
fail-fast: false
|
95
|
+
matrix:
|
96
|
+
rails:
|
97
|
+
- v7.0.0
|
98
|
+
- v6.1.4
|
99
|
+
- v6.0.4
|
100
|
+
- 6-0-stable
|
101
|
+
- 5-2-stable
|
102
|
+
- v5.2.4
|
103
|
+
ruby:
|
104
|
+
- 3.0.2
|
105
|
+
- 2.7.4
|
106
|
+
- 2.6.7
|
107
|
+
exclude:
|
108
|
+
- rails: v7.0.0
|
109
|
+
ruby: 2.6.7
|
110
|
+
- rails: v5.2.4
|
111
|
+
ruby: 3.0.2
|
112
|
+
- rails: 5-2-stable
|
113
|
+
ruby: 3.0.2
|
114
|
+
env:
|
115
|
+
DB: postgres
|
116
|
+
RAILS: ${{ matrix.rails }}
|
117
|
+
DATABASE_USERNAME: postgres
|
118
|
+
DATABASE_PASSWORD: postgres
|
119
|
+
DATABASE_HOST: 127.0.0.1
|
120
|
+
services:
|
121
|
+
postgres:
|
122
|
+
image: postgres
|
123
|
+
ports:
|
124
|
+
- 5432:5432
|
125
|
+
env:
|
126
|
+
POSTGRES_PASSWORD: postgres
|
127
|
+
POSTGRES_HOST_AUTH_METHOD: trust
|
128
|
+
# Set health checks to wait until postgres has started
|
129
|
+
options: >-
|
130
|
+
--health-cmd pg_isready
|
131
|
+
--health-interval 10s
|
132
|
+
--health-timeout 5s
|
133
|
+
--health-retries 5
|
134
|
+
|
135
|
+
steps:
|
136
|
+
- uses: actions/checkout@v2
|
137
|
+
- name: Set up Ruby
|
138
|
+
uses: ruby/setup-ruby@v1
|
139
|
+
with:
|
140
|
+
ruby-version: ${{ matrix.ruby }}
|
141
|
+
- name: Setup databases
|
142
|
+
run: |
|
143
|
+
psql -h localhost -p 5432 -W postgres -c 'create database ransack;' -U postgres;
|
144
|
+
- name: Install dependencies
|
145
|
+
run: bundle install
|
146
|
+
- name: Run tests
|
147
|
+
run: bundle exec rspec
|
148
|
+
|
149
|
+
bug-report-templates:
|
150
|
+
runs-on: ubuntu-20.04
|
151
|
+
steps:
|
152
|
+
- uses: actions/checkout@v2
|
153
|
+
- name: Set up Ruby
|
154
|
+
uses: ruby/setup-ruby@v1
|
155
|
+
with:
|
156
|
+
ruby-version: 3.0.2
|
157
|
+
- name: Install dependencies
|
158
|
+
run: bundle install
|
159
|
+
- name: Run bug report templates
|
160
|
+
run: |
|
161
|
+
ruby bug_report_templates/test-ransacker-arel-present-predicate.rb
|
162
|
+
ruby bug_report_templates/test-ransack-scope-and-column-same-name.rb
|
163
|
+
rm Gemfile Gemfile.lock
|
data/.rubocop.yml
ADDED
@@ -0,0 +1,44 @@
|
|
1
|
+
AllCops:
|
2
|
+
TargetRubyVersion: 2.6
|
3
|
+
|
4
|
+
DisabledByDefault: true
|
5
|
+
|
6
|
+
Layout/EmptyLineAfterMagicComment:
|
7
|
+
Enabled: true
|
8
|
+
|
9
|
+
Layout/EmptyLineBetweenDefs:
|
10
|
+
Enabled: true
|
11
|
+
|
12
|
+
Layout/EmptyLines:
|
13
|
+
Enabled: true
|
14
|
+
|
15
|
+
Layout/FirstArrayElementIndentation:
|
16
|
+
EnforcedStyle: consistent
|
17
|
+
|
18
|
+
Layout/SpaceAfterComma:
|
19
|
+
Enabled: true
|
20
|
+
|
21
|
+
Layout/SpaceInsideBlockBraces:
|
22
|
+
Enabled: true
|
23
|
+
|
24
|
+
Layout/SpaceInsideHashLiteralBraces:
|
25
|
+
Enabled: true
|
26
|
+
|
27
|
+
Layout/SpaceInsideParens:
|
28
|
+
Enabled: true
|
29
|
+
|
30
|
+
Layout/TrailingEmptyLines:
|
31
|
+
Enabled: true
|
32
|
+
|
33
|
+
Style/RedundantFileExtensionInRequire:
|
34
|
+
Enabled: true
|
35
|
+
|
36
|
+
Style/RedundantReturn:
|
37
|
+
Enabled: true
|
38
|
+
|
39
|
+
Style/SelfAssignment:
|
40
|
+
Enabled: true
|
41
|
+
|
42
|
+
Style/Semicolon:
|
43
|
+
Enabled: true
|
44
|
+
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,32 @@
|
|
1
1
|
# Change Log
|
2
2
|
|
3
|
+
## Unreleased
|
4
|
+
|
5
|
+
## 2.5.0 - 2021-12-26
|
6
|
+
|
7
|
+
* ActiveRecord 7.0 support
|
8
|
+
|
9
|
+
* Drop support for rubies under 2.5. PR #1189
|
10
|
+
|
11
|
+
* Have casted array predicates type checked to Arel::Nodes::Casted fixing non-casted array predicates.
|
12
|
+
PR [1246](https://github.com/activerecord-hackery/ransack/pull/1246)
|
13
|
+
|
14
|
+
## 2.4.1 - 2020-12-21
|
15
|
+
|
16
|
+
* Add `ActiveRecord::Base.ransack!` which raises error if passed unknown condition
|
17
|
+
|
18
|
+
*Aaron Lipman*
|
19
|
+
|
20
|
+
## 2.4.0 - 2020-11-27
|
21
|
+
|
22
|
+
* Support ActiveRecord 6.1.0.rc1.
|
23
|
+
PR [1172](https://github.com/activerecord-hackery/ransack/pull/1172)
|
24
|
+
|
25
|
+
* Fix for ActiveRecord 5.2.4 (note security fix in 5.2.4.2 for ActiveView's escape_javascript CVE-2020-5267 for all earlier versions)
|
26
|
+
|
27
|
+
* Drop support for ActiveRecord older than 5.2.4.
|
28
|
+
PR [1166](https://github.com/activerecord-hackery/ransack/pull/1166)
|
29
|
+
|
3
30
|
## 2.3.2 - 2020-01-11
|
4
31
|
|
5
32
|
* Breakfix to bump Polyamorous
|
@@ -182,7 +209,7 @@
|
|
182
209
|
ignored when block parameter is specified.
|
183
210
|
PR [#818](https://github.com/activerecord-hackery/ransack/pull/818).
|
184
211
|
|
185
|
-
* No need pass some
|
212
|
+
* No need pass some arguments to JoinAssociation#join_constraints in Rails 5.1.
|
186
213
|
PR [#814](https://github.com/activerecord-hackery/ransack/pull/814).
|
187
214
|
Fixes [#807](https://github.com/activerecord-hackery/ransack/issues/807).
|
188
215
|
Reference [rails/rails#28267](https://github.com/rails/rails/pull/28267)
|
data/CONTRIBUTING.md
CHANGED
@@ -26,8 +26,8 @@ Steps:
|
|
26
26
|
Ransack and not in your code or another gem.
|
27
27
|
|
28
28
|
4. **Report the issue** by providing the link to a self-contained
|
29
|
-
gist like [this](https://
|
30
|
-
[this](https://
|
29
|
+
gist like [this](https://github.com/activerecord-hackery/ransack/blob/run_bug_report_templates/bug_report_templates/test-ransack-scope-and-column-same-name.rb) or
|
30
|
+
[this](https://github.com/activerecord-hackery/ransack/blob/run_bug_report_templates/bug_report_templates/test-ransacker-arel-present-predicate.rb). Please use
|
31
31
|
these code examples as a bug-report template for your Ransack issue!
|
32
32
|
|
33
33
|
If you do not provide a self-contained gist and would like your issue to be reviewed, do provide at a minimum:
|
@@ -64,6 +64,9 @@ Here's a quick guide:
|
|
64
64
|
2. Create a thoughtfully-named branch for your changes (`git checkout -b my-new-feature`).
|
65
65
|
|
66
66
|
3. Install the development dependencies by running `bundle install`.
|
67
|
+
To install rails other than latest (set in Gemfile): `RAILS='5-2-stable' bundle install`
|
68
|
+
|
69
|
+
$ RAILS='5-2-stable' bundle install
|
67
70
|
|
68
71
|
4. Begin by running the tests. We only take pull requests with passing tests,
|
69
72
|
and it's great to know that you have a clean slate:
|
@@ -84,16 +87,18 @@ Here's a quick guide:
|
|
84
87
|
$ mysql -u root
|
85
88
|
mysql> create database ransack;
|
86
89
|
|
87
|
-
|
90
|
+
The test suite runs by default
|
91
|
+
|
92
|
+
To run only the tests in a particular file: `bundle exec rspec <path/to/filename>`
|
88
93
|
|
89
|
-
$ rspec spec/ransack/search_spec.rb
|
94
|
+
$ bundle exec rspec spec/ransack/search_spec.rb
|
90
95
|
|
91
|
-
To run a single test in that file: `rspec <path/to/filename> -e "test name"`
|
96
|
+
To run a single test in that file: `bundle exec rspec <path/to/filename> -e "test name"`
|
92
97
|
|
93
|
-
$ rspec spec/ransack/search_spec.rb -e "accepts a context option"
|
98
|
+
$ bundle exec rspec spec/ransack/search_spec.rb -e "accepts a context option"
|
94
99
|
|
95
|
-
5. Hack away! Please use Ruby features that are compatible down to Ruby
|
96
|
-
Since version 1
|
100
|
+
5. Hack away! Please use Ruby features that are compatible down to Ruby 2.3.
|
101
|
+
Since version 2.3.1, Ransack no longer maintains Ruby 2.2 compatibility.
|
97
102
|
|
98
103
|
6. Add tests for your changes. Only refactoring and documentation changes
|
99
104
|
require no new tests. If you are adding functionality or fixing a bug, we
|
@@ -110,9 +115,9 @@ Here's a quick guide:
|
|
110
115
|
$ git config --global user.email "contributor@example.com"
|
111
116
|
|
112
117
|
10. Commit your changes (`git commit -am 'Add feature/fix bug/improve docs'`).
|
113
|
-
|
114
|
-
|
115
|
-
|
118
|
+
If your pull request only contains documentation changes, please remember
|
119
|
+
to add `[skip ci]` to the beginning of your commit message so the CI
|
120
|
+
test suite doesn't :runner: needlessly.
|
116
121
|
|
117
122
|
11. If necessary, rebase your commits into logical chunks, without errors. To
|
118
123
|
interactively rebase and cherry-pick from, say, the last 10 commits:
|
data/Gemfile
CHANGED
@@ -14,10 +14,10 @@ rails_version = case rails
|
|
14
14
|
rails
|
15
15
|
end
|
16
16
|
|
17
|
-
gem 'faker', '~> 0
|
18
|
-
gem 'sqlite3', ::Gem::Version.new(rails_version) >= ::Gem::Version.new('6-0-stable') ? '~> 1.4.1' : '~> 1.3.3'
|
17
|
+
gem 'faker', '~> 2.0'
|
18
|
+
gem 'sqlite3', ::Gem::Version.new(rails_version == 'main' ? '6.2.0.alpha' : rails_version) >= ::Gem::Version.new('6-0-stable') ? '~> 1.4.1' : '~> 1.3.3'
|
19
19
|
gem 'pg', '~> 1.0'
|
20
|
-
gem 'pry', '0.
|
20
|
+
gem 'pry', '~> 0.12.2'
|
21
21
|
gem 'byebug'
|
22
22
|
|
23
23
|
case rails
|
@@ -49,3 +49,5 @@ group :test do
|
|
49
49
|
gem 'rspec', '~> 3'
|
50
50
|
gem 'simplecov', :require => false
|
51
51
|
end
|
52
|
+
|
53
|
+
gem 'rubocop', require: false
|