ransack 2.4.1 → 2.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.github/workflows/cronjob.yml +105 -0
- data/.github/workflows/rubocop.yml +20 -0
- data/.github/workflows/test.yml +37 -3
- data/.rubocop.yml +44 -0
- data/CHANGELOG.md +4 -3
- data/CONTRIBUTING.md +2 -2
- data/Gemfile +4 -2
- 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 +20 -0
- data/lib/polyamorous/activerecord_6.2_ruby_2/join_association.rb +1 -0
- data/lib/polyamorous/activerecord_6.2_ruby_2/join_dependency.rb +1 -0
- data/lib/polyamorous/activerecord_6.2_ruby_2/reflection.rb +1 -0
- data/lib/polyamorous/polyamorous.rb +1 -1
- data/lib/ransack.rb +2 -2
- data/lib/ransack/adapters/active_record/context.rb +3 -3
- data/lib/ransack/adapters/active_record/ransack/constants.rb +1 -1
- data/lib/ransack/constants.rb +2 -3
- data/lib/ransack/helpers.rb +1 -1
- data/lib/ransack/helpers/form_builder.rb +3 -3
- data/lib/ransack/nodes/attribute.rb +1 -1
- data/lib/ransack/nodes/condition.rb +0 -2
- data/lib/ransack/nodes/sort.rb +1 -1
- data/lib/ransack/nodes/value.rb +1 -1
- data/lib/ransack/version.rb +1 -1
- data/ransack.gemspec +4 -3
- 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/adapters/active_record/base_spec.rb +2 -3
- data/spec/ransack/adapters/active_record/context_spec.rb +1 -2
- data/spec/ransack/helpers/form_helper_spec.rb +16 -16
- data/spec/ransack/nodes/grouping_spec.rb +2 -2
- data/spec/ransack/predicate_spec.rb +1 -1
- data/spec/spec_helper.rb +7 -6
- data/spec/support/schema.rb +0 -2
- metadata +13 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a7e53f2a86ba264e751c3311254c7cb4b25efdb0c876310835b6f6221ab24928
|
4
|
+
data.tar.gz: 161ca5255a24fa42c63d6afbbf38e518581189db773e7e43940b31b1b8d86850
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 17c4701dbf3523dfa16feae0dd0dddc8bd077237d7e695eb69664f1b9c5ab5e2fea4a59b5878fe8e607b135ea834f12284f03c42a9ce2971f2f9c9b65d347205
|
7
|
+
data.tar.gz: 4c9d09980609ffc43bc505a947781b9fcdc97efb7897c3bbc3278d8391ab219e4fdffd8a813272a3af7403eefc162fddb6f9f379b713894d3951ff2fc7a141f3
|
@@ -0,0 +1,105 @@
|
|
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.0
|
15
|
+
- 2.7.2
|
16
|
+
- 2.6.6
|
17
|
+
env:
|
18
|
+
DB: sqlite3
|
19
|
+
RAILS: main
|
20
|
+
steps:
|
21
|
+
- uses: actions/checkout@v2
|
22
|
+
- name: Set up Ruby
|
23
|
+
uses: ruby/setup-ruby@v1
|
24
|
+
with:
|
25
|
+
ruby-version: ${{ matrix.ruby }}
|
26
|
+
- name: Install dependencies
|
27
|
+
run: bundle install
|
28
|
+
- name: Run tests
|
29
|
+
run: bundle exec rspec
|
30
|
+
|
31
|
+
mysql:
|
32
|
+
runs-on: ubuntu-20.04
|
33
|
+
strategy:
|
34
|
+
fail-fast: false
|
35
|
+
matrix:
|
36
|
+
ruby:
|
37
|
+
- 3.0.0
|
38
|
+
- 2.7.2
|
39
|
+
- 2.6.6
|
40
|
+
env:
|
41
|
+
DB: mysql
|
42
|
+
RAILS: main
|
43
|
+
MYSQL_USERNAME: root
|
44
|
+
MYSQL_PASSWORD: root
|
45
|
+
steps:
|
46
|
+
- uses: actions/checkout@v2
|
47
|
+
- name: Set up Ruby
|
48
|
+
uses: ruby/setup-ruby@v1
|
49
|
+
with:
|
50
|
+
ruby-version: ${{ matrix.ruby }}
|
51
|
+
- name: Startup MySQL
|
52
|
+
run: |
|
53
|
+
sudo systemctl start mysql.service
|
54
|
+
- name: Setup databases
|
55
|
+
run: |
|
56
|
+
mysql --user=root --password=root --host=127.0.0.1 -e 'create database ransack collate utf8_general_ci;';
|
57
|
+
mysql --user=root --password=root --host=127.0.0.1 -e 'use ransack;show variables like "%character%";show variables like "%collation%";';
|
58
|
+
- name: Install dependencies
|
59
|
+
run: bundle install
|
60
|
+
- name: Run tests
|
61
|
+
run: bundle exec rspec
|
62
|
+
|
63
|
+
postgres:
|
64
|
+
runs-on: ubuntu-20.04
|
65
|
+
strategy:
|
66
|
+
fail-fast: false
|
67
|
+
matrix:
|
68
|
+
ruby:
|
69
|
+
- 3.0.0
|
70
|
+
- 2.7.2
|
71
|
+
- 2.6.6
|
72
|
+
env:
|
73
|
+
DB: postgres
|
74
|
+
RAILS: main
|
75
|
+
DATABASE_USERNAME: postgres
|
76
|
+
DATABASE_PASSWORD: postgres
|
77
|
+
DATABASE_HOST: 127.0.0.1
|
78
|
+
services:
|
79
|
+
postgres:
|
80
|
+
image: postgres
|
81
|
+
ports:
|
82
|
+
- 5432:5432
|
83
|
+
env:
|
84
|
+
POSTGRES_PASSWORD: postgres
|
85
|
+
POSTGRES_HOST_AUTH_METHOD: trust
|
86
|
+
# Set health checks to wait until postgres has started
|
87
|
+
options: >-
|
88
|
+
--health-cmd pg_isready
|
89
|
+
--health-interval 10s
|
90
|
+
--health-timeout 5s
|
91
|
+
--health-retries 5
|
92
|
+
|
93
|
+
steps:
|
94
|
+
- uses: actions/checkout@v2
|
95
|
+
- name: Set up Ruby
|
96
|
+
uses: ruby/setup-ruby@v1
|
97
|
+
with:
|
98
|
+
ruby-version: ${{ matrix.ruby }}
|
99
|
+
- name: Setup databases
|
100
|
+
run: |
|
101
|
+
psql -h localhost -p 5432 -W postgres -c 'create database ransack;' -U postgres;
|
102
|
+
- name: Install dependencies
|
103
|
+
run: bundle install
|
104
|
+
- name: Run tests
|
105
|
+
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.0
|
17
|
+
- name: Install gems
|
18
|
+
run: bundle install --jobs 4 --retry 3
|
19
|
+
- name: Run RuboCop
|
20
|
+
run: bundle exec rubocop --parallel
|
data/.github/workflows/test.yml
CHANGED
@@ -11,14 +11,20 @@ jobs:
|
|
11
11
|
fail-fast: false
|
12
12
|
matrix:
|
13
13
|
rails:
|
14
|
-
- v6.1.
|
14
|
+
- v6.1.1
|
15
15
|
- v6.0.3
|
16
16
|
- 6-0-stable
|
17
17
|
- 5-2-stable
|
18
18
|
- v5.2.4
|
19
19
|
ruby:
|
20
|
+
- 3.0.0
|
20
21
|
- 2.7.2
|
21
22
|
- 2.6.6
|
23
|
+
exclude:
|
24
|
+
- rails: v5.2.4
|
25
|
+
ruby: 3.0.0
|
26
|
+
- rails: 5-2-stable
|
27
|
+
ruby: 3.0.0
|
22
28
|
env:
|
23
29
|
DB: sqlite3
|
24
30
|
RAILS: ${{ matrix.rails }}
|
@@ -39,14 +45,20 @@ jobs:
|
|
39
45
|
fail-fast: false
|
40
46
|
matrix:
|
41
47
|
rails:
|
42
|
-
- v6.1.
|
48
|
+
- v6.1.1
|
43
49
|
- v6.0.3
|
44
50
|
- 6-0-stable
|
45
51
|
- 5-2-stable
|
46
52
|
- v5.2.4
|
47
53
|
ruby:
|
54
|
+
- 3.0.0
|
48
55
|
- 2.7.2
|
49
56
|
- 2.6.6
|
57
|
+
exclude:
|
58
|
+
- rails: v5.2.4
|
59
|
+
ruby: 3.0.0
|
60
|
+
- rails: 5-2-stable
|
61
|
+
ruby: 3.0.0
|
50
62
|
env:
|
51
63
|
DB: mysql
|
52
64
|
RAILS: ${{ matrix.rails }}
|
@@ -76,14 +88,20 @@ jobs:
|
|
76
88
|
fail-fast: false
|
77
89
|
matrix:
|
78
90
|
rails:
|
79
|
-
- v6.1.
|
91
|
+
- v6.1.1
|
80
92
|
- v6.0.3
|
81
93
|
- 6-0-stable
|
82
94
|
- 5-2-stable
|
83
95
|
- v5.2.4
|
84
96
|
ruby:
|
97
|
+
- 3.0.0
|
85
98
|
- 2.7.2
|
86
99
|
- 2.6.6
|
100
|
+
exclude:
|
101
|
+
- rails: v5.2.4
|
102
|
+
ruby: 3.0.0
|
103
|
+
- rails: 5-2-stable
|
104
|
+
ruby: 3.0.0
|
87
105
|
env:
|
88
106
|
DB: postgres
|
89
107
|
RAILS: ${{ matrix.rails }}
|
@@ -118,3 +136,19 @@ jobs:
|
|
118
136
|
run: bundle install
|
119
137
|
- name: Run tests
|
120
138
|
run: bundle exec rspec
|
139
|
+
|
140
|
+
bug-report-templates:
|
141
|
+
runs-on: ubuntu-20.04
|
142
|
+
steps:
|
143
|
+
- uses: actions/checkout@v2
|
144
|
+
- name: Set up Ruby
|
145
|
+
uses: ruby/setup-ruby@v1
|
146
|
+
with:
|
147
|
+
ruby-version: 3.0.0
|
148
|
+
- name: Install dependencies
|
149
|
+
run: bundle install
|
150
|
+
- name: Run bug report templates
|
151
|
+
run: |
|
152
|
+
ruby bug_report_templates/test-ransacker-arel-present-predicate.rb
|
153
|
+
ruby bug_report_templates/test-ransack-scope-and-column-same-name.rb
|
154
|
+
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,14 +1,15 @@
|
|
1
1
|
# Change Log
|
2
2
|
|
3
|
+
* Drop support for rubies under 2.5. PR #1189
|
4
|
+
|
5
|
+
## 2.4.1 - 2020-12-21
|
6
|
+
|
3
7
|
* Add `ActiveRecord::Base.ransack!` which raises error if passed unknown condition
|
4
8
|
|
5
9
|
*Aaron Lipman*
|
6
10
|
|
7
11
|
## 2.4.0 - 2020-11-27
|
8
12
|
|
9
|
-
*
|
10
|
-
PR []()
|
11
|
-
|
12
13
|
* Support ActiveRecord 6.1.0.rc1.
|
13
14
|
PR [1172](https://github.com/activerecord-hackery/ransack/pull/1172)
|
14
15
|
|
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:
|
data/Gemfile
CHANGED
@@ -14,8 +14,8 @@ rails_version = case rails
|
|
14
14
|
rails
|
15
15
|
end
|
16
16
|
|
17
|
-
gem 'faker', '~>
|
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
20
|
gem 'pry', '~> 0.12.2'
|
21
21
|
gem 'byebug'
|
@@ -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
|
@@ -0,0 +1,78 @@
|
|
1
|
+
# test-ransack-scope-and-column-same-name.rb
|
2
|
+
|
3
|
+
# This is a stand-alone test case.
|
4
|
+
|
5
|
+
# Run it in your console with: `ruby test-ransack-scope-and-column-same-name.rb`
|
6
|
+
|
7
|
+
# If you change the gem dependencies, run it with:
|
8
|
+
# `rm gemfile* && ruby test-ransack-scope-and-column-same-name.rb`
|
9
|
+
|
10
|
+
unless File.exist?('Gemfile')
|
11
|
+
File.write('Gemfile', <<-GEMFILE)
|
12
|
+
source 'https://rubygems.org'
|
13
|
+
|
14
|
+
# Rails master
|
15
|
+
gem 'rails', github: 'rails/rails', branch: '6-1-stable'
|
16
|
+
|
17
|
+
# Rails last release
|
18
|
+
# gem 'rails'
|
19
|
+
|
20
|
+
gem 'sqlite3'
|
21
|
+
gem 'ransack', github: 'activerecord-hackery/ransack'
|
22
|
+
GEMFILE
|
23
|
+
|
24
|
+
system 'bundle install'
|
25
|
+
end
|
26
|
+
|
27
|
+
require 'bundler'
|
28
|
+
Bundler.setup(:default)
|
29
|
+
|
30
|
+
require 'active_record'
|
31
|
+
require 'minitest/autorun'
|
32
|
+
require 'logger'
|
33
|
+
require 'ransack'
|
34
|
+
|
35
|
+
# This connection will do for database-independent bug reports.
|
36
|
+
ActiveRecord::Base.establish_connection(adapter: 'sqlite3', database: ':memory:')
|
37
|
+
ActiveRecord::Base.logger = Logger.new(STDOUT)
|
38
|
+
|
39
|
+
# Display versions.
|
40
|
+
message = "Running test case with Ruby #{RUBY_VERSION}, Active Record #{
|
41
|
+
::ActiveRecord::VERSION::STRING}, Arel #{Arel::VERSION} and #{
|
42
|
+
::ActiveRecord::Base.connection.adapter_name}"
|
43
|
+
line = '=' * message.length
|
44
|
+
puts line, message, line
|
45
|
+
|
46
|
+
ActiveRecord::Schema.define do
|
47
|
+
create_table :users, force: true do |t|
|
48
|
+
t.boolean :active, null: false, default: true
|
49
|
+
end
|
50
|
+
end
|
51
|
+
|
52
|
+
class User < ActiveRecord::Base
|
53
|
+
scope :activated, -> (boolean = true) { where(active: boolean) }
|
54
|
+
|
55
|
+
private
|
56
|
+
|
57
|
+
def self.ransackable_scopes(auth_object = nil)
|
58
|
+
%i(activated)
|
59
|
+
end
|
60
|
+
end
|
61
|
+
|
62
|
+
class BugTest < Minitest::Test
|
63
|
+
def test_activated_scope_equals_true
|
64
|
+
sql = User.ransack({ activated: true }).result.to_sql
|
65
|
+
puts sql
|
66
|
+
assert_equal(
|
67
|
+
"SELECT \"users\".* FROM \"users\" WHERE \"users\".\"active\" = 1", sql
|
68
|
+
)
|
69
|
+
end
|
70
|
+
|
71
|
+
def test_activated_scope_equals_false
|
72
|
+
sql = User.ransack({ activated: false }).result.to_sql
|
73
|
+
puts sql
|
74
|
+
assert_equal(
|
75
|
+
"SELECT \"users\".* FROM \"users\"", sql
|
76
|
+
)
|
77
|
+
end
|
78
|
+
end
|
@@ -0,0 +1,71 @@
|
|
1
|
+
# test-ransacker-arel-present-predicate.rb
|
2
|
+
|
3
|
+
# Run it in your console with: `ruby test-ransacker-arel-present-predicate.rb`
|
4
|
+
|
5
|
+
# If you change the gem dependencies, run it with:
|
6
|
+
# `rm gemfile* && ruby test-ransacker-arel-present-predicate.rb`
|
7
|
+
|
8
|
+
unless File.exist?('Gemfile')
|
9
|
+
File.write('Gemfile', <<-GEMFILE)
|
10
|
+
source 'https://rubygems.org'
|
11
|
+
|
12
|
+
# Rails master
|
13
|
+
gem 'rails', github: 'rails/rails', branch: '6-1-stable'
|
14
|
+
|
15
|
+
# Rails last release
|
16
|
+
# gem 'rails'
|
17
|
+
|
18
|
+
gem 'sqlite3'
|
19
|
+
gem 'ransack', github: 'activerecord-hackery/ransack'
|
20
|
+
GEMFILE
|
21
|
+
|
22
|
+
system 'bundle install'
|
23
|
+
end
|
24
|
+
|
25
|
+
require 'bundler'
|
26
|
+
Bundler.setup(:default)
|
27
|
+
|
28
|
+
require 'active_record'
|
29
|
+
require 'minitest/autorun'
|
30
|
+
require 'logger'
|
31
|
+
require 'ransack'
|
32
|
+
|
33
|
+
# This connection will do for database-independent bug reports.
|
34
|
+
ActiveRecord::Base.establish_connection(adapter: 'sqlite3', database: ':memory:')
|
35
|
+
ActiveRecord::Base.logger = Logger.new(STDOUT)
|
36
|
+
|
37
|
+
# Display versions.
|
38
|
+
message = "Running test case with Ruby #{RUBY_VERSION}, Active Record #{
|
39
|
+
::ActiveRecord::VERSION::STRING}, Arel #{Arel::VERSION} and #{
|
40
|
+
::ActiveRecord::Base.connection.adapter_name}"
|
41
|
+
line = '=' * message.length
|
42
|
+
puts line, message, line
|
43
|
+
|
44
|
+
ActiveRecord::Schema.define do
|
45
|
+
create_table :projects, force: true do |t|
|
46
|
+
t.string :name
|
47
|
+
t.string :number
|
48
|
+
end
|
49
|
+
end
|
50
|
+
|
51
|
+
class Project < ActiveRecord::Base
|
52
|
+
ransacker :name do
|
53
|
+
Arel.sql('projects.name')
|
54
|
+
end
|
55
|
+
|
56
|
+
ransacker :number do |parent|
|
57
|
+
parent.table[:number]
|
58
|
+
end
|
59
|
+
end
|
60
|
+
|
61
|
+
class BugTest < Minitest::Test
|
62
|
+
def test_ransackers
|
63
|
+
sql = Project.ransack({ number_present: 1 }).result.to_sql
|
64
|
+
puts sql
|
65
|
+
assert_equal "SELECT \"projects\".* FROM \"projects\" WHERE (\"projects\".\"number\" IS NOT NULL AND \"projects\".\"number\" != '')", sql
|
66
|
+
|
67
|
+
sql = Project.ransack({ name_present: 1 }).result.to_sql
|
68
|
+
puts sql
|
69
|
+
assert_equal "SELECT \"projects\".* FROM \"projects\" WHERE (projects.name IS NOT NULL AND projects.name != '')", sql
|
70
|
+
end
|
71
|
+
end
|
Binary file
|
@@ -0,0 +1,20 @@
|
|
1
|
+
## Release Process
|
2
|
+
|
3
|
+
*For maintainers of Ransack.*
|
4
|
+
|
5
|
+
To release a new version of Ransack and publish it to RubyGems, take the following steps:
|
6
|
+
|
7
|
+
- Create a new release, marked `Prerelease`.
|
8
|
+
<<<<<<< Updated upstream
|
9
|
+
- Update the versions file to the new release, commit and push to `master`.
|
10
|
+
=======
|
11
|
+
- Update the [version.rb](../lib/ransack/version.rb) file to the new release, commit and push to `master`.
|
12
|
+
>>>>>>> Stashed changes
|
13
|
+
- From the terminal, run the following commands
|
14
|
+
|
15
|
+
```bash
|
16
|
+
rake build
|
17
|
+
rake release
|
18
|
+
```
|
19
|
+
|
20
|
+

|
@@ -0,0 +1 @@
|
|
1
|
+
require 'polyamorous/activerecord_6.1_ruby_2/join_association'
|
@@ -0,0 +1 @@
|
|
1
|
+
require 'polyamorous/activerecord_6.1_ruby_2/join_dependency'
|
@@ -0,0 +1 @@
|
|
1
|
+
require 'polyamorous/activerecord_6.1_ruby_2/reflection'
|
@@ -11,7 +11,7 @@ if defined?(::ActiveRecord)
|
|
11
11
|
require 'polyamorous/join'
|
12
12
|
require 'polyamorous/swapping_reflection_class'
|
13
13
|
|
14
|
-
ar_version = ::ActiveRecord::VERSION::STRING[0,3]
|
14
|
+
ar_version = ::ActiveRecord::VERSION::STRING[0, 3]
|
15
15
|
%w(join_association join_dependency reflection).each do |file|
|
16
16
|
require "polyamorous/activerecord_#{ar_version}_ruby_2/#{file}"
|
17
17
|
end
|
data/lib/ransack.rb
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
require 'active_support/core_ext'
|
2
2
|
require 'ransack/configuration'
|
3
3
|
require 'ransack/adapters'
|
4
|
-
require 'polyamorous/polyamorous
|
4
|
+
require 'polyamorous/polyamorous'
|
5
5
|
|
6
6
|
Ransack::Adapters.object_mapper.require_constants
|
7
7
|
|
8
8
|
module Ransack
|
9
9
|
extend Configuration
|
10
|
-
class UntraversableAssociationError < StandardError; end
|
10
|
+
class UntraversableAssociationError < StandardError; end
|
11
11
|
end
|
12
12
|
|
13
13
|
Ransack.configure do |config|
|
@@ -106,7 +106,7 @@ module Ransack
|
|
106
106
|
def join_sources
|
107
107
|
base, joins = begin
|
108
108
|
alias_tracker = ::ActiveRecord::Associations::AliasTracker.create(self.klass.connection, @object.table.name, [])
|
109
|
-
constraints = if ::Gem::Version.new(::ActiveRecord::VERSION::STRING) >= ::Gem::Version.new(Constants::
|
109
|
+
constraints = if ::Gem::Version.new(::ActiveRecord::VERSION::STRING) >= ::Gem::Version.new(Constants::RAILS_6_1)
|
110
110
|
@join_dependency.join_constraints(@object.joins_values, alias_tracker, @object.references_values)
|
111
111
|
elsif ::Gem::Version.new(::ActiveRecord::VERSION::STRING) >= ::Gem::Version.new(Constants::RAILS_6_0)
|
112
112
|
@join_dependency.join_constraints(@object.joins_values, alias_tracker)
|
@@ -334,7 +334,7 @@ module Ransack
|
|
334
334
|
@join_dependency.instance_variable_get(:@join_root).children.push found_association
|
335
335
|
|
336
336
|
# Builds the arel nodes properly for this association
|
337
|
-
if ::Gem::Version.new(::ActiveRecord::VERSION::STRING) >= ::Gem::Version.new(Constants::
|
337
|
+
if ::Gem::Version.new(::ActiveRecord::VERSION::STRING) >= ::Gem::Version.new(Constants::RAILS_6_1)
|
338
338
|
@tables_pot[found_association] = @join_dependency.construct_tables_for_association!(jd.instance_variable_get(:@join_root), found_association)
|
339
339
|
else
|
340
340
|
@join_dependency.send(:construct_tables!, jd.instance_variable_get(:@join_root))
|
@@ -348,7 +348,7 @@ module Ransack
|
|
348
348
|
def extract_joins(association)
|
349
349
|
parent = @join_dependency.instance_variable_get(:@join_root)
|
350
350
|
reflection = association.reflection
|
351
|
-
join_constraints = if ::Gem::Version.new(::ActiveRecord::VERSION::STRING) >= ::Gem::Version.new(Constants::
|
351
|
+
join_constraints = if ::Gem::Version.new(::ActiveRecord::VERSION::STRING) >= ::Gem::Version.new(Constants::RAILS_6_1)
|
352
352
|
association.join_constraints_with_tables(
|
353
353
|
parent.table,
|
354
354
|
parent.base_klass,
|
@@ -97,7 +97,7 @@ module Ransack
|
|
97
97
|
arel_predicate: proc { |v| v ? EQ : NOT_EQ },
|
98
98
|
compounds: false,
|
99
99
|
type: :boolean,
|
100
|
-
validator: proc { |v| BOOLEAN_VALUES.include?(v)},
|
100
|
+
validator: proc { |v| BOOLEAN_VALUES.include?(v) },
|
101
101
|
formatter: proc { |v| nil }
|
102
102
|
}
|
103
103
|
],
|
data/lib/ransack/constants.rb
CHANGED
@@ -36,7 +36,7 @@ module Ransack
|
|
36
36
|
'lt'.freeze, 'lteq'.freeze,
|
37
37
|
'gt'.freeze, 'gteq'.freeze,
|
38
38
|
'in'.freeze, 'not_in'.freeze
|
39
|
-
|
39
|
+
].freeze
|
40
40
|
A_S_I = ['a'.freeze, 's'.freeze, 'i'.freeze].freeze
|
41
41
|
|
42
42
|
EQ = 'eq'.freeze
|
@@ -46,10 +46,9 @@ module Ransack
|
|
46
46
|
CONT = 'cont'.freeze
|
47
47
|
|
48
48
|
RAILS_6_0 = '6.0.0'.freeze
|
49
|
-
|
49
|
+
RAILS_6_1 = '6.1.0'.freeze
|
50
50
|
|
51
51
|
RANSACK_SLASH_SEARCHES = 'ransack/searches'.freeze
|
52
52
|
RANSACK_SLASH_SEARCHES_SLASH_SEARCH = 'ransack/searches/search'.freeze
|
53
53
|
end
|
54
54
|
end
|
55
|
-
|
data/lib/ransack/helpers.rb
CHANGED
@@ -1,2 +1,2 @@
|
|
1
1
|
require 'ransack/helpers/form_builder'
|
2
|
-
require 'ransack/helpers/form_helper'
|
2
|
+
require 'ransack/helpers/form_helper'
|
@@ -45,9 +45,9 @@ module Ransack
|
|
45
45
|
end
|
46
46
|
|
47
47
|
def attribute_select(options = nil, html_options = nil, action = nil)
|
48
|
-
options
|
49
|
-
html_options
|
50
|
-
action
|
48
|
+
options ||= {}
|
49
|
+
html_options ||= {}
|
50
|
+
action ||= Constants::SEARCH
|
51
51
|
default = options.delete(:default)
|
52
52
|
raise ArgumentError, formbuilder_error_message(
|
53
53
|
"#{action}_select") unless object.respond_to?(:context)
|
@@ -127,7 +127,6 @@ module Ransack
|
|
127
127
|
alias :m= :combinator=
|
128
128
|
alias :m :combinator
|
129
129
|
|
130
|
-
|
131
130
|
# == build_attribute
|
132
131
|
#
|
133
132
|
# This method was originally called from Nodes::Grouping#new_condition
|
@@ -263,7 +262,6 @@ module Ransack
|
|
263
262
|
attr.attr
|
264
263
|
end
|
265
264
|
|
266
|
-
|
267
265
|
def default_type
|
268
266
|
predicate.type || (attributes.first && attributes.first.type)
|
269
267
|
end
|
data/lib/ransack/nodes/sort.rb
CHANGED
data/lib/ransack/nodes/value.rb
CHANGED
data/lib/ransack/version.rb
CHANGED
data/ransack.gemspec
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
# -*- encoding: utf-8 -*-
|
2
|
+
|
2
3
|
$:.push File.expand_path("../lib", __FILE__)
|
3
4
|
require "ransack/version"
|
4
5
|
|
@@ -6,12 +7,12 @@ Gem::Specification.new do |s|
|
|
6
7
|
s.name = "ransack"
|
7
8
|
s.version = Ransack::VERSION
|
8
9
|
s.platform = Gem::Platform::RUBY
|
9
|
-
s.authors = ["Ernie Miller", "Ryan Bigg", "Jon Atack","Sean Carroll"]
|
10
|
-
s.email = ["ernie@erniemiller.org", "radarlistener@gmail.com", "jonnyatack@gmail.com","sfcarroll@gmail.com"]
|
10
|
+
s.authors = ["Ernie Miller", "Ryan Bigg", "Jon Atack", "Sean Carroll"]
|
11
|
+
s.email = ["ernie@erniemiller.org", "radarlistener@gmail.com", "jonnyatack@gmail.com", "sfcarroll@gmail.com"]
|
11
12
|
s.homepage = "https://github.com/activerecord-hackery/ransack"
|
12
13
|
s.summary = %q{Object-based searching for Active Record and Mongoid (currently).}
|
13
14
|
s.description = %q{Ransack is the successor to the MetaSearch gem. It improves and expands upon MetaSearch's functionality, but does not have a 100%-compatible API.}
|
14
|
-
s.required_ruby_version = '>= 2.
|
15
|
+
s.required_ruby_version = '>= 2.6'
|
15
16
|
s.license = 'MIT'
|
16
17
|
|
17
18
|
s.add_dependency 'activerecord', '>= 5.2.4'
|
data/spec/blueprints/articles.rb
CHANGED
data/spec/blueprints/comments.rb
CHANGED
data/spec/blueprints/notes.rb
CHANGED
data/spec/blueprints/tags.rb
CHANGED
data/spec/console.rb
CHANGED
@@ -14,11 +14,11 @@ Sham.define do
|
|
14
14
|
title { Faker::Lorem.sentence }
|
15
15
|
body { Faker::Lorem.paragraph }
|
16
16
|
salary { |index| 30000 + (index * 1000) }
|
17
|
-
tag_name { Faker::Lorem.words(3).join(' ') }
|
18
|
-
note { Faker::Lorem.words(7).join(' ') }
|
19
|
-
only_admin { Faker::Lorem.words(3).join(' ') }
|
20
|
-
only_search { Faker::Lorem.words(3).join(' ') }
|
21
|
-
only_sort { Faker::Lorem.words(3).join(' ') }
|
17
|
+
tag_name { Faker::Lorem.words(number: 3).join(' ') }
|
18
|
+
note { Faker::Lorem.words(number: 7).join(' ') }
|
19
|
+
only_admin { Faker::Lorem.words(number: 3).join(' ') }
|
20
|
+
only_search { Faker::Lorem.words(number: 3).join(' ') }
|
21
|
+
only_sort { Faker::Lorem.words(number: 3).join(' ') }
|
22
22
|
notable_id { |id| id }
|
23
23
|
end
|
24
24
|
|
@@ -464,9 +464,9 @@ module Ransack
|
|
464
464
|
Comment.create(article: Article.create(title: 'Avenger'), person: Person.create(salary: 100_000)),
|
465
465
|
Comment.create(article: Article.create(title: 'Avenge'), person: Person.create(salary: 50_000)),
|
466
466
|
]
|
467
|
-
expect(Comment.ransack(article_title_cont: 'aven',s: 'person_salary desc').result).to eq(comments)
|
467
|
+
expect(Comment.ransack(article_title_cont: 'aven', s: 'person_salary desc').result).to eq(comments)
|
468
468
|
expect(Comment.joins(:person).ransack(s: 'persons_salarydesc', article_title_cont: 'aven').result).to eq(comments)
|
469
|
-
expect(Comment.joins(:person).ransack(article_title_cont: 'aven',s: 'persons_salary desc').result).to eq(comments)
|
469
|
+
expect(Comment.joins(:person).ransack(article_title_cont: 'aven', s: 'persons_salary desc').result).to eq(comments)
|
470
470
|
end
|
471
471
|
|
472
472
|
it 'allows sort by `only_sort` field' do
|
@@ -545,7 +545,6 @@ module Ransack
|
|
545
545
|
)
|
546
546
|
end
|
547
547
|
|
548
|
-
|
549
548
|
it 'should allow passing ransacker arguments to a ransacker' do
|
550
549
|
s = Person.ransack(
|
551
550
|
c: [{
|
@@ -9,7 +9,6 @@ module Ransack
|
|
9
9
|
describe Context do
|
10
10
|
subject { Context.new(Person) }
|
11
11
|
|
12
|
-
|
13
12
|
it 'has an Active Record alias tracker method' do
|
14
13
|
expect(subject.alias_tracker)
|
15
14
|
.to be_an ::ActiveRecord::Associations::AliasTracker
|
@@ -81,7 +80,7 @@ module Ransack
|
|
81
80
|
end
|
82
81
|
|
83
82
|
it 'build correlated subquery for multiple conditions (default scope)' do
|
84
|
-
search = Search.new(Person, { comments_body_not_eq: 'some_title'})
|
83
|
+
search = Search.new(Person, { comments_body_not_eq: 'some_title' })
|
85
84
|
|
86
85
|
# Was
|
87
86
|
# SELECT "people".* FROM "people" WHERE "people"."id" NOT IN (
|
@@ -186,7 +186,7 @@ module Ransack
|
|
186
186
|
)
|
187
187
|
}
|
188
188
|
it {
|
189
|
-
should match(
|
189
|
+
should match(/people\?q(%5B|\[)s(%5D|\])(%5B|\[)(%5D|\])=name\+asc&q(%5B|\[)s(%5D|\])(%5B|\[)(%5D|\])=email\+desc/
|
190
190
|
)
|
191
191
|
}
|
192
192
|
it { should match /sort_link desc/ }
|
@@ -202,7 +202,7 @@ module Ransack
|
|
202
202
|
)
|
203
203
|
}
|
204
204
|
it {
|
205
|
-
should match(
|
205
|
+
should match(/people\?q(%5B|\[)s(%5D|\])(%5B|\[)(%5D|\])=name\+asc&q(%5B|\[)s(%5D|\])(%5B|\[)(%5D|\])=email\+desc/
|
206
206
|
)
|
207
207
|
}
|
208
208
|
end
|
@@ -216,7 +216,7 @@ module Ransack
|
|
216
216
|
)
|
217
217
|
}
|
218
218
|
it {
|
219
|
-
should match(
|
219
|
+
should match(/people\?q(%5B|\[)s(%5D|\])(%5B|\[)(%5D|\])=name\+asc&q(%5B|\[)s(%5D|\])(%5B|\[)(%5D|\])=email\+desc/
|
220
220
|
)
|
221
221
|
}
|
222
222
|
it { should match /sort_link desc/ }
|
@@ -232,7 +232,7 @@ module Ransack
|
|
232
232
|
)
|
233
233
|
}
|
234
234
|
it {
|
235
|
-
should match(
|
235
|
+
should match(/people\?q(%5B|\[)s(%5D|\])(%5B|\[)(%5D|\])=name\+asc&q(%5B|\[)s(%5D|\])(%5B|\[)(%5D|\])=email\+desc/
|
236
236
|
)
|
237
237
|
}
|
238
238
|
end
|
@@ -258,7 +258,7 @@ module Ransack
|
|
258
258
|
)
|
259
259
|
}
|
260
260
|
it {
|
261
|
-
should match(
|
261
|
+
should match(/people\?q(%5B|\[)s(%5D|\])(%5B|\[)(%5D|\])=name\+asc&q(%5B|\[)s(%5D|\])(%5B|\[)(%5D|\])=email\+desc/
|
262
262
|
)
|
263
263
|
}
|
264
264
|
it { should match /sort_link desc/ }
|
@@ -274,7 +274,7 @@ module Ransack
|
|
274
274
|
)
|
275
275
|
}
|
276
276
|
it {
|
277
|
-
should match(
|
277
|
+
should match(/people\?q(%5B|\[)s(%5D|\])(%5B|\[)(%5D|\])=name\+asc&q(%5B|\[)s(%5D|\])(%5B|\[)(%5D|\])=email\+desc/
|
278
278
|
)
|
279
279
|
}
|
280
280
|
end
|
@@ -289,7 +289,7 @@ module Ransack
|
|
289
289
|
)
|
290
290
|
}
|
291
291
|
it {
|
292
|
-
should match(
|
292
|
+
should match(/people\?q(%5B|\[)s(%5D|\])(%5B|\[)(%5D|\])=name\+desc&q(%5B|\[)s(%5D|\])(%5B|\[)(%5D|\])=email\+desc/
|
293
293
|
)
|
294
294
|
}
|
295
295
|
it { should match /sort_link/ }
|
@@ -306,7 +306,7 @@ module Ransack
|
|
306
306
|
)
|
307
307
|
}
|
308
308
|
it {
|
309
|
-
should match(
|
309
|
+
should match(/people\?q(%5B|\[)s(%5D|\])(%5B|\[)(%5D|\])=name\+desc&q(%5B|\[)s(%5D|\])(%5B|\[)(%5D|\])=email\+desc/
|
310
310
|
)
|
311
311
|
}
|
312
312
|
end
|
@@ -321,7 +321,7 @@ module Ransack
|
|
321
321
|
)
|
322
322
|
}
|
323
323
|
it {
|
324
|
-
should match(
|
324
|
+
should match(/people\?q(%5B|\[)s(%5D|\])(%5B|\[)(%5D|\])=name\+desc&q(%5B|\[)s(%5D|\])(%5B|\[)(%5D|\])=email\+desc/
|
325
325
|
)
|
326
326
|
}
|
327
327
|
it { should match /sort_link/ }
|
@@ -338,7 +338,7 @@ module Ransack
|
|
338
338
|
)
|
339
339
|
}
|
340
340
|
it {
|
341
|
-
should match(
|
341
|
+
should match(/people\?q(%5B|\[)s(%5D|\])(%5B|\[)(%5D|\])=name\+desc&q(%5B|\[)s(%5D|\])(%5B|\[)(%5D|\])=email\+desc/
|
342
342
|
)
|
343
343
|
}
|
344
344
|
end
|
@@ -353,7 +353,7 @@ module Ransack
|
|
353
353
|
)
|
354
354
|
}
|
355
355
|
it {
|
356
|
-
should match(
|
356
|
+
should match(/people\?q(%5B|\[)s(%5D|\])(%5B|\[)(%5D|\])=name\+desc&q(%5B|\[)s(%5D|\])(%5B|\[)(%5D|\])=email\+asc/
|
357
357
|
)
|
358
358
|
}
|
359
359
|
it { should match /sort_link/ }
|
@@ -370,7 +370,7 @@ module Ransack
|
|
370
370
|
)
|
371
371
|
}
|
372
372
|
it {
|
373
|
-
should match(
|
373
|
+
should match(/people\?q(%5B|\[)s(%5D|\])(%5B|\[)(%5D|\])=name\+desc&q(%5B|\[)s(%5D|\])(%5B|\[)(%5D|\])=email\+asc/
|
374
374
|
)
|
375
375
|
}
|
376
376
|
end
|
@@ -385,7 +385,7 @@ module Ransack
|
|
385
385
|
)
|
386
386
|
}
|
387
387
|
it {
|
388
|
-
should match(
|
388
|
+
should match(/people\?q(%5B|\[)s(%5D|\])(%5B|\[)(%5D|\])=name\+desc&q(%5B|\[)s(%5D|\])(%5B|\[)(%5D|\])=email\+desc/
|
389
389
|
)
|
390
390
|
}
|
391
391
|
it { should match /sort_link/ }
|
@@ -402,7 +402,7 @@ module Ransack
|
|
402
402
|
)
|
403
403
|
}
|
404
404
|
it {
|
405
|
-
should match(
|
405
|
+
should match(/people\?q(%5B|\[)s(%5D|\])(%5B|\[)(%5D|\])=name\+desc&q(%5B|\[)s(%5D|\])(%5B|\[)(%5D|\])=email\+desc/
|
406
406
|
)
|
407
407
|
}
|
408
408
|
end
|
@@ -643,13 +643,13 @@ module Ransack
|
|
643
643
|
before do
|
644
644
|
Ransack.configure do |c|
|
645
645
|
c.hide_sort_order_indicators = false
|
646
|
-
c.custom_arrows = { default_arrow: "defaultarrow"}
|
646
|
+
c.custom_arrows = { default_arrow: "defaultarrow" }
|
647
647
|
end
|
648
648
|
end
|
649
649
|
|
650
650
|
after do
|
651
651
|
Ransack.configure do |c|
|
652
|
-
c.custom_arrows = { default_arrow: nil}
|
652
|
+
c.custom_arrows = { default_arrow: nil }
|
653
653
|
end
|
654
654
|
end
|
655
655
|
|
@@ -80,7 +80,7 @@ module Ransack
|
|
80
80
|
'a' => {
|
81
81
|
'0' => {
|
82
82
|
'name' => 'with_arguments',
|
83
|
-
'ransacker_args' => [1,2]
|
83
|
+
'ransacker_args' => [1, 2]
|
84
84
|
}
|
85
85
|
},
|
86
86
|
'p' => 'eq',
|
@@ -90,7 +90,7 @@ module Ransack
|
|
90
90
|
'a' => {
|
91
91
|
'0' => {
|
92
92
|
'name' => 'with_arguments',
|
93
|
-
'ransacker_args' => [3,4]
|
93
|
+
'ransacker_args' => [3, 4]
|
94
94
|
}
|
95
95
|
},
|
96
96
|
'p' => 'eq',
|
@@ -422,7 +422,7 @@ module Ransack
|
|
422
422
|
context "defining custom predicates" do
|
423
423
|
describe "with 'not_in' arel predicate" do
|
424
424
|
before do
|
425
|
-
Ransack.configure {|c| c.add_predicate "not_in_csv", arel_predicate: "not_in", formatter: proc { |v| v.split(",") } }
|
425
|
+
Ransack.configure { |c| c.add_predicate "not_in_csv", arel_predicate: "not_in", formatter: proc { |v| v.split(",") } }
|
426
426
|
end
|
427
427
|
|
428
428
|
it 'generates a value IS NOT NULL query' do
|
data/spec/spec_helper.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
require 'machinist/active_record'
|
2
|
-
require 'polyamorous/polyamorous
|
2
|
+
require 'polyamorous/polyamorous'
|
3
3
|
require 'sham'
|
4
4
|
require 'faker'
|
5
5
|
require 'ransack'
|
@@ -17,16 +17,17 @@ I18n.load_path += Dir[File.join(File.dirname(__FILE__), 'support', '*.yml')]
|
|
17
17
|
Dir[File.expand_path('../{helpers,support,blueprints}/*.rb', __FILE__)]
|
18
18
|
.each { |f| require f }
|
19
19
|
|
20
|
+
Faker::Config.random = Random.new(0)
|
20
21
|
Sham.define do
|
21
22
|
name { Faker::Name.name }
|
22
23
|
title { Faker::Lorem.sentence }
|
23
24
|
body { Faker::Lorem.paragraph }
|
24
25
|
salary { |index| 30000 + (index * 1000) }
|
25
|
-
tag_name { Faker::Lorem.words(3).join(' ') }
|
26
|
-
note { Faker::Lorem.words(7).join(' ') }
|
27
|
-
only_admin { Faker::Lorem.words(3).join(' ') }
|
28
|
-
only_search { Faker::Lorem.words(3).join(' ') }
|
29
|
-
only_sort { Faker::Lorem.words(3).join(' ') }
|
26
|
+
tag_name { Faker::Lorem.words(number: 3).join(' ') }
|
27
|
+
note { Faker::Lorem.words(number: 7).join(' ') }
|
28
|
+
only_admin { Faker::Lorem.words(number: 3).join(' ') }
|
29
|
+
only_search { Faker::Lorem.words(number: 3).join(' ') }
|
30
|
+
only_sort { Faker::Lorem.words(number: 3).join(' ') }
|
30
31
|
notable_id { |id| id }
|
31
32
|
end
|
32
33
|
|
data/spec/support/schema.rb
CHANGED
@@ -87,7 +87,6 @@ class Person < ActiveRecord::Base
|
|
87
87
|
)
|
88
88
|
end
|
89
89
|
|
90
|
-
|
91
90
|
ransacker :sql_literal_id do
|
92
91
|
Arel.sql('people.id')
|
93
92
|
end
|
@@ -110,7 +109,6 @@ class Person < ActiveRecord::Base
|
|
110
109
|
Arel.sql(query)
|
111
110
|
end
|
112
111
|
|
113
|
-
|
114
112
|
def self.ransackable_attributes(auth_object = nil)
|
115
113
|
if auth_object == :admin
|
116
114
|
super - ['only_sort']
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ransack
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.4.
|
4
|
+
version: 2.4.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ernie Miller
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date:
|
14
|
+
date: 2021-01-23 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: activerecord
|
@@ -68,14 +68,21 @@ extra_rdoc_files: []
|
|
68
68
|
files:
|
69
69
|
- ".github/FUNDING.yml"
|
70
70
|
- ".github/SECURITY.md"
|
71
|
+
- ".github/workflows/cronjob.yml"
|
72
|
+
- ".github/workflows/rubocop.yml"
|
71
73
|
- ".github/workflows/test.yml"
|
72
74
|
- ".gitignore"
|
75
|
+
- ".rubocop.yml"
|
73
76
|
- CHANGELOG.md
|
74
77
|
- CONTRIBUTING.md
|
75
78
|
- Gemfile
|
76
79
|
- LICENSE
|
77
80
|
- README.md
|
78
81
|
- Rakefile
|
82
|
+
- bug_report_templates/test-ransack-scope-and-column-same-name.rb
|
83
|
+
- bug_report_templates/test-ransacker-arel-present-predicate.rb
|
84
|
+
- docs/img/create_release.png
|
85
|
+
- docs/release_process.md
|
79
86
|
- lib/polyamorous/activerecord_5.2_ruby_2/join_association.rb
|
80
87
|
- lib/polyamorous/activerecord_5.2_ruby_2/join_dependency.rb
|
81
88
|
- lib/polyamorous/activerecord_5.2_ruby_2/reflection.rb
|
@@ -85,6 +92,9 @@ files:
|
|
85
92
|
- lib/polyamorous/activerecord_6.1_ruby_2/join_association.rb
|
86
93
|
- lib/polyamorous/activerecord_6.1_ruby_2/join_dependency.rb
|
87
94
|
- lib/polyamorous/activerecord_6.1_ruby_2/reflection.rb
|
95
|
+
- lib/polyamorous/activerecord_6.2_ruby_2/join_association.rb
|
96
|
+
- lib/polyamorous/activerecord_6.2_ruby_2/join_dependency.rb
|
97
|
+
- lib/polyamorous/activerecord_6.2_ruby_2/reflection.rb
|
88
98
|
- lib/polyamorous/join.rb
|
89
99
|
- lib/polyamorous/polyamorous.rb
|
90
100
|
- lib/polyamorous/swapping_reflection_class.rb
|
@@ -188,7 +198,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
188
198
|
requirements:
|
189
199
|
- - ">="
|
190
200
|
- !ruby/object:Gem::Version
|
191
|
-
version: '2.
|
201
|
+
version: '2.6'
|
192
202
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
193
203
|
requirements:
|
194
204
|
- - ">="
|