ransack 3.0.0 → 3.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (34) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/deploy.yml +35 -0
  3. data/.github/workflows/test-deploy.yml +29 -0
  4. data/.github/workflows/test.yml +10 -25
  5. data/CHANGELOG.md +47 -0
  6. data/CONTRIBUTING.md +1 -1
  7. data/Gemfile +2 -2
  8. data/README.md +1 -1
  9. data/docs/.gitignore +0 -1
  10. data/docs/docs/getting-started/using-predicates.md +1 -1
  11. data/docs/docs/going-further/acts-as-taggable-on.md +114 -0
  12. data/docs/docs/going-further/documentation.md +14 -2
  13. data/docs/docs/going-further/merging-searches.md +1 -1
  14. data/docs/docs/going-further/polymorphic-search.md +40 -0
  15. data/docs/docs/going-further/wiki-contributors.md +82 -0
  16. data/docs/docusaurus.config.js +2 -3
  17. data/docs/yarn.lock +3 -3
  18. data/lib/polyamorous/activerecord_6.1_ruby_2/reflection.rb +11 -1
  19. data/lib/polyamorous/activerecord_7.1_ruby_2/join_association.rb +1 -0
  20. data/lib/polyamorous/activerecord_7.1_ruby_2/join_dependency.rb +1 -0
  21. data/lib/polyamorous/activerecord_7.1_ruby_2/reflection.rb +1 -0
  22. data/lib/ransack/adapters/active_record/context.rb +17 -49
  23. data/lib/ransack/adapters/active_record/ransack/nodes/condition.rb +2 -10
  24. data/lib/ransack/constants.rb +0 -3
  25. data/lib/ransack/helpers/form_helper.rb +1 -1
  26. data/lib/ransack/version.rb +1 -1
  27. data/ransack.gemspec +3 -3
  28. data/spec/helpers/polyamorous_helper.rb +2 -8
  29. data/spec/ransack/helpers/form_helper_spec.rb +24 -0
  30. metadata +16 -12
  31. data/docs/package-lock.json +0 -9207
  32. data/lib/polyamorous/activerecord_6.0_ruby_2/join_association.rb +0 -20
  33. data/lib/polyamorous/activerecord_6.0_ruby_2/join_dependency.rb +0 -79
  34. data/lib/polyamorous/activerecord_6.0_ruby_2/reflection.rb +0 -11
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 400fa6bc00b27207224ee94101cd526a602076669e1824c605e9897d3fd6ba7c
4
- data.tar.gz: df6443d69d67e1a59ab97378784c8ddbb3966d3dd6376e3362bacae0afea72c6
3
+ metadata.gz: 3f37dfefd63333903d6b36084a8dda1193ca31788777b2645d25b96dd97d2d2c
4
+ data.tar.gz: dba86f7268c931801e1caf32f3552ebfeecc06fec2f773130118cc2c809c61e9
5
5
  SHA512:
6
- metadata.gz: e620b446afd597cfa16e20be2f20d762791d496cd24ec3441f8553697b81a0ac50280da1ec07a068962f06937cfb7fdbaeeab33dd17fbdb0233226cd42f95d6a
7
- data.tar.gz: 30b74e2d17fbb7e215ff60a129f1bf4af779e0b1d6d62865e1d8dfb8b9215d6a06f0008f1704e6fb25ab83e25dafa0f2fa219c57588eafe5260b14a0f9c5f0f0
6
+ metadata.gz: 7c8364c70e6536c5aa5dca37c5539164d89dab6fb9e582501dbf5611ff4a647aa0b5ff69450a0b4d480de4d61e62708b3c376ffb6813c0f06ff6b0a591c670f6
7
+ data.tar.gz: 4681b4c7f4e03002b968e165abf930a6b42dfc1e4d740a0bb8a034a9c805b1f956d6f82ab5ca0e39117a8a08b8899b849e34ccf665ac5f7c36fd1aec83ebe3e5
@@ -0,0 +1,35 @@
1
+ name: Deploy to GitHub Pages
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - main
7
+
8
+ jobs:
9
+ deploy:
10
+ name: Deploy to GitHub Pages
11
+
12
+ runs-on: ubuntu-20.04
13
+
14
+ steps:
15
+ - uses: actions/checkout@v3
16
+
17
+ - uses: actions/setup-node@v3
18
+ with:
19
+ node-version: 16
20
+ cache: yarn
21
+ cache-dependency-path: docs/yarn.lock
22
+
23
+ - name: Install dependencies
24
+ run: yarn install --frozen-lockfile
25
+ working-directory: docs
26
+
27
+ - name: Build website
28
+ run: yarn build
29
+ working-directory: docs
30
+
31
+ - name: Deploy to GitHub Pages
32
+ uses: peaceiris/actions-gh-pages@v3
33
+ with:
34
+ github_token: ${{ secrets.GITHUB_TOKEN }}
35
+ publish_dir: docs/build
@@ -0,0 +1,29 @@
1
+ name: Test deploy to GitHub Pages
2
+
3
+ on:
4
+ pull_request:
5
+ branches:
6
+ - main
7
+
8
+ jobs:
9
+ test-deploy:
10
+ name: Test deploy to GitHub Pages
11
+
12
+ runs-on: ubuntu-20.04
13
+
14
+ steps:
15
+ - uses: actions/checkout@v3
16
+
17
+ - uses: actions/setup-node@v3
18
+ with:
19
+ node-version: 16
20
+ cache: yarn
21
+ cache-dependency-path: docs/yarn.lock
22
+
23
+ - name: Install dependencies
24
+ run: yarn install --frozen-lockfile
25
+ working-directory: docs
26
+
27
+ - name: Test build website
28
+ run: yarn build
29
+ working-directory: docs
@@ -11,17 +11,12 @@ jobs:
11
11
  fail-fast: false
12
12
  matrix:
13
13
  rails:
14
- - v7.0.0
15
- - v6.1.4
16
- - v6.0.4
17
- - 6-0-stable
14
+ - v7.0.2
15
+ - v6.1.5
18
16
  ruby:
17
+ - 3.1.1
19
18
  - 3.0.2
20
19
  - 2.7.4
21
- - 2.6.7
22
- exclude:
23
- - rails: v7.0.0
24
- ruby: 2.6.7
25
20
  env:
26
21
  DB: sqlite3
27
22
  RAILS: ${{ matrix.rails }}
@@ -42,17 +37,12 @@ jobs:
42
37
  fail-fast: false
43
38
  matrix:
44
39
  rails:
45
- - v7.0.0
46
- - v6.1.4
47
- - v6.0.4
48
- - 6-0-stable
40
+ - v7.0.2
41
+ - v6.1.5
49
42
  ruby:
43
+ - 3.1.1
50
44
  - 3.0.2
51
45
  - 2.7.4
52
- - 2.6.7
53
- exclude:
54
- - rails: v7.0.0
55
- ruby: 2.6.7
56
46
  env:
57
47
  DB: mysql
58
48
  RAILS: ${{ matrix.rails }}
@@ -82,17 +72,12 @@ jobs:
82
72
  fail-fast: false
83
73
  matrix:
84
74
  rails:
85
- - v7.0.0
86
- - v6.1.4
87
- - v6.0.4
88
- - 6-0-stable
75
+ - v7.0.2
76
+ - v6.1.5
89
77
  ruby:
78
+ - 3.1.1
90
79
  - 3.0.2
91
80
  - 2.7.4
92
- - 2.6.7
93
- exclude:
94
- - rails: v7.0.0
95
- ruby: 2.6.7
96
81
  env:
97
82
  DB: postgres
98
83
  RAILS: ${{ matrix.rails }}
@@ -135,7 +120,7 @@ jobs:
135
120
  - name: Set up Ruby
136
121
  uses: ruby/setup-ruby@v1
137
122
  with:
138
- ruby-version: 3.0.2
123
+ ruby-version: 3.1.1
139
124
  - name: Install dependencies
140
125
  run: bundle install
141
126
  - name: Run bug report templates
data/CHANGELOG.md CHANGED
@@ -2,6 +2,53 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ ## 3.2.0 - 2022-05-08
6
+
7
+ * Drop Rails 6.0 support.
8
+ PR [1318](https://github.com/activerecord-hackery/ransack/pull/1318)
9
+
10
+ * Exclude "host" from params sent to url generator.
11
+ PR [1319](https://github.com/activerecord-hackery/ransack/pull/1319)
12
+
13
+ ## 3.1.0 - 2022-04-21
14
+
15
+ * Fix predicate name in "Using Predicates" documentation page.
16
+ PR [1313](https://github.com/activerecord-hackery/ransack/pull/1313)
17
+
18
+ * Drop Ruby 2.6 support.
19
+ PR [1311](https://github.com/activerecord-hackery/ransack/pull/1311)
20
+
21
+ * Allow Ransack to be used with Rails 7.1.0.alpha.
22
+ PR [1309](https://github.com/activerecord-hackery/ransack/pull/1309)
23
+
24
+ * Put contributor list last in documentation site.
25
+ PR [1308](https://github.com/activerecord-hackery/ransack/pull/1308)
26
+
27
+ * Add `acts-as-taggable-on` and polymorphic searches to documentation.
28
+ PR [1306](https://github.com/activerecord-hackery/ransack/pull/1306)
29
+ PR [1312](https://github.com/activerecord-hackery/ransack/pull/1312)
30
+
31
+ * Add full link to issue about merging searches to documentation.
32
+ PR [1305](https://github.com/activerecord-hackery/ransack/pull/1305)
33
+
34
+ ## 3.0.1 - 2022-04-08
35
+
36
+ * Fix `:data` option to `sort_link` being incorrectly appended to the generated
37
+ link query parameters.
38
+ PR [1301](https://github.com/activerecord-hackery/ransack/pull/1301)
39
+
40
+ * Fix "Edit this page" links in documentation site
41
+ PR [1303](https://github.com/activerecord-hackery/ransack/pull/1303)
42
+
43
+ * Auto deploy documentation site after merging PRs
44
+ PR [1302](https://github.com/activerecord-hackery/ransack/pull/1302)
45
+
46
+ * Add list of former wiki contributors to documentation site
47
+ PR [1300](https://github.com/activerecord-hackery/ransack/pull/1300)
48
+
49
+ * Reduce gem package size
50
+ PR [1297](https://github.com/activerecord-hackery/ransack/pull/1297)
51
+
5
52
  ## 3.0.0 - 2022-03-30
6
53
 
7
54
  * Move documentation into Docusaurus.
data/CONTRIBUTING.md CHANGED
@@ -64,7 +64,7 @@ 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='6-0-stable' bundle install`
67
+ To install rails other than latest (set in Gemfile): `RAILS='6-1-stable' bundle install`
68
68
 
69
69
  4. Begin by running the tests. We only take pull requests with passing tests,
70
70
  and it's great to know that you have a clean slate:
data/Gemfile CHANGED
@@ -3,7 +3,7 @@ gemspec
3
3
 
4
4
  gem 'rake'
5
5
 
6
- rails = ENV['RAILS'] || '6-0-stable'
6
+ rails = ENV['RAILS'] || '6-1-stable'
7
7
 
8
8
  rails_version = case rails
9
9
  when /\// # A path
@@ -15,7 +15,7 @@ rails_version = case rails
15
15
  end
16
16
 
17
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'
18
+ gem 'sqlite3', '~> 1.4.1'
19
19
  gem 'pg', '~> 1.0'
20
20
  gem 'pry', '~> 0.12.2'
21
21
  gem 'byebug'
data/README.md CHANGED
@@ -96,7 +96,7 @@ Support this project by becoming a sponsor. Your logo will show up here with a l
96
96
  <a href="https://opencollective.com/ransack/sponsor/1/website" target="_blank"><img src="https://opencollective.com/ransack/sponsor/1/avatar.svg" /></a>
97
97
  <a href="https://opencollective.com/ransack/sponsor/2/website" target="_blank"><img src="https://opencollective.com/ransack/sponsor/2/avatar.svg" /></a>
98
98
  <a href="https://opencollective.com/ransack/sponsor/3/website" target="_blank"><img src="https://opencollective.com/ransack/sponsor/3/avatar.svg" /></a>
99
- <a href="https://opencollective.com/ransack/sponsor/4/website" target="_blank"><img src="https://opencollective.com/ransack/sponsor/4/avatar.svg"/ ></a>
99
+ <a href="https://opencollective.com/ransack/sponsor/4/website" target="_blank"><img src="https://opencollective.com/ransack/sponsor/4/avatar.svg" /></a>
100
100
  <a href="https://opencollective.com/ransack/sponsor/5/website" target="_blank"><img src="https://opencollective.com/ransack/sponsor/5/avatar.svg" /></a>
101
101
  <a href="https://opencollective.com/ransack/sponsor/6/website" target="_blank"><img src="https://opencollective.com/ransack/sponsor/6/avatar.svg" /></a>
102
102
  <a href="https://opencollective.com/ransack/sponsor/7/website" target="_blank"><img src="https://opencollective.com/ransack/sponsor/7/avatar.svg" /></a>
data/docs/.gitignore CHANGED
@@ -15,6 +15,5 @@
15
15
  .env.test.local
16
16
  .env.production.local
17
17
 
18
- npm-debug.log*
19
18
  yarn-debug.log*
20
19
  yarn-error.log*
@@ -23,7 +23,7 @@ You can also combine predicates for OR queries:
23
23
  The syntax for `OR` queries on an associated model is not immediately obvious, but makes sense. Assuming a `User` `has_one` `Account` and the `Account` has `attributes` `foo` and `bar`:
24
24
 
25
25
  ```ruby
26
- >> User.ransack(account_foo_or_account_bar: 'val').result.to_sql
26
+ >> User.ransack(account_foo_or_account_bar_cont: 'val').result.to_sql
27
27
  => SELECT "users".* FROM "users" INNER JOIN accounts ON accounts.user_id = users.id WHERE ("accounts.foo LIKE '%val%' OR accounts.bar LIKE '%val%')
28
28
  ```
29
29
 
@@ -0,0 +1,114 @@
1
+ ---
2
+ title: Acts-as-taggable-on
3
+ sidebar_position: 13
4
+ ---
5
+
6
+ ## Using Acts As Taggable On
7
+
8
+ If you have an `ActiveRecord` model and you're using [acts-as-taggable-on](https://github.com/mbleigh/acts-as-taggable-on),
9
+ chances are you might want to search on tagged fields. Follow the instructions to install the gem and then set up your project files.
10
+
11
+ ### Configure the model
12
+
13
+ `app/models/tasks.rb`
14
+
15
+ You can call the tagging field anything you like, it just needs to be plural. No migration is needed as this is stored in the internal ActsAsTaggable tables (`tags` and `taggings`).
16
+
17
+ ```rb
18
+ class Task < ApplicationRecord
19
+ acts_as_taggable_on :projects
20
+ end
21
+ ```
22
+
23
+ ### Controller
24
+
25
+ Add a field to strong params in the controller. Use the singular name with `_list`.
26
+
27
+ `app/controllers/tasks_controller.rb`
28
+
29
+ ```rb
30
+ def strong_params
31
+ params
32
+ .require(:tasks)
33
+ .permit(:task, :example_field, :project_list)
34
+ ```
35
+
36
+ ### Form
37
+
38
+ We need to `send` the tag fieldname to our model, also using the singular naming.
39
+
40
+ ```
41
+ <div class='form-group'>
42
+ <%= f.label :project_list %>
43
+ <%= f.text_field :project_list, value: @task.send(:project_list).to_s %>
44
+ </div>
45
+ ```
46
+
47
+ Now we can collect our data via the form, with tags separated by commas.
48
+
49
+ ## Ransack Search
50
+
51
+ Imagine you have the following two instances of `Task`:
52
+
53
+ ```rb
54
+ { id: 1, name: 'Clean up my room', projects: [ 'Home', 'Personal' ] }
55
+ { id: 2, name: 'Complete math exercises', projects: [ 'Homework', 'Study' ] }
56
+ ```
57
+
58
+ When you're writing a `Ransack` search form, you can choose any of the following options:
59
+
60
+ ```erb
61
+ <%= search_form_for @search do |f| %>
62
+ <%= f.text_field :projects_name_in %> <!-- option a -->
63
+ <%= f.text_field :projects_name_eq %> <!-- option b -->
64
+ <%= f.text_field :projects_name_cont %> <!-- option c -->
65
+ <% end %>
66
+ ```
67
+
68
+ ### Option A - Match keys exactly
69
+
70
+ Option `a` will match keys exactly. This is the solution to choose if you want to distinguish 'Home' from 'Homework': searching for 'Home' will return just the `Task` with id 1. It also allows searching for more than one tag at once (comma separated):
71
+ - `Home, Personal` will return task 1
72
+ - `Home, Homework` will return task 1 and 2
73
+
74
+ ### Option B - match key combinations
75
+
76
+ Option `b` will match all keys exactly. This is the solution if you wanna search for specific combinations of tags:
77
+ - `Home` will return nothing, as there is no Task with just the `Home` tag
78
+ - `Home, Personal` will return task 1
79
+
80
+ ### Option C - match substrings
81
+
82
+ Option `c` is used to match substrings. This is useful when you don't care for the exact tag, but only for part of it:
83
+ - `Home` will return task 1 and 2 (`/Home/` matches both `"Home"` and `"Homework"`)
84
+
85
+ ### Option D - select from a list of tags
86
+
87
+ In Option D we allow the user to select a list of valid tags and then search againt them. We use the plural name here.
88
+
89
+ ```erb
90
+ <div class='form-group'>
91
+ <%= f.label :projects_name, 'Project' %>
92
+ <%= f.select :projects_name_in, ActsAsTaggableOn::Tag.distinct.order(:name).pluck(:name) %>
93
+ </div>
94
+ ```
95
+
96
+ ## Multitenancy
97
+
98
+ ActsAsTaggableOn allows scoping of tags based on another field on the model. Suppose we have a `language` field on the model, as an effective second level key. We would adjust our model to look like this:
99
+
100
+ ```rb
101
+ class Task < ApplicationRecord
102
+ acts_as_taggable_on :projects
103
+ acts_as_taggable_tenant :language
104
+ end
105
+ ```
106
+
107
+ The Ransack search is then filtered using the `for_tenant` method
108
+
109
+ ```
110
+ <div class='form-group'>
111
+ <%= f.label :projects_name, 'Project' %>
112
+ <%= f.select :projects_name_in, ActsAsTaggableOn::Tag.for_tenant('fr').distinct.order(:name).pluck(:name) %>
113
+ </div>
114
+
@@ -7,12 +7,24 @@ Ransack uses [Docusaurus](https://docusaurus.io/) for documentation. To contribu
7
7
 
8
8
  ### Local Development
9
9
 
10
+ Switch to docs folder
11
+
10
12
  ```
11
13
  cd docs
12
- yarn start
13
14
  ```
14
15
 
15
- This command starts a local development server and opens up a browser window. Most changes are reflected live without having to restart the server.
16
+ Install docusaurus and other dependencies
17
+
18
+ ```
19
+ yarn install
20
+ ```
21
+
22
+
23
+ Start a local development server and open up a browser window. Most changes are reflected live without having to restart the server.
24
+
25
+ ```
26
+ yarn start
27
+ ```
16
28
 
17
29
  ### Build
18
30
 
@@ -38,4 +38,4 @@ WHERE (
38
38
  ORDER BY "people"."id" DESC
39
39
  ```
40
40
 
41
- Admittedly this is not as simple as it should be, but it's workable for now. (Implementing #417 could make this more straightforward.)
41
+ Admittedly this is not as simple as it should be, but it's workable for now. (Implementing [issue 417](https://github.com/activerecord-hackery/ransack/issues/417) could make this more straightforward.)
@@ -0,0 +1,40 @@
1
+ ---
2
+ title: Polymorphic Searches
3
+ sidebar_position: 14
4
+ ---
5
+
6
+ When making searches from polymorphic models it is necessary to specify the type of model you are searching.
7
+
8
+ For example:
9
+
10
+ Given two models
11
+
12
+ ```ruby
13
+ class House < ActiveRecord::Base
14
+ has_one :location, as: :locatable
15
+ end
16
+
17
+ class Location < ActiveRecord::Base
18
+ belongs_to :locatable, polymorphic: true
19
+ end
20
+ ```
21
+
22
+ Normally (without polymorphic relationship) you would be able to search as per below:
23
+
24
+ ```ruby
25
+ Location.ransack(locatable_number_eq: 100).result
26
+ ```
27
+
28
+ However when this is searched you will get the following error
29
+
30
+ ```ruby
31
+ ActiveRecord::EagerLoadPolymorphicError: Can not eagerly load the polymorphic association :locatable
32
+ ```
33
+
34
+ In order to search for locations by house number when the relationship is polymorphic you have to specify the type of records you will be searching and construct your search as below:
35
+
36
+ ```ruby
37
+ Location.ransack(locatable_of_House_type_number_eq: 100).result
38
+ ```
39
+
40
+ note the `_of_House_type_` added to the search key. This allows Ransack to correctly specify the table names in SQL join queries.
@@ -0,0 +1,82 @@
1
+ ---
2
+ title: Wiki Contributors
3
+ sidebar_position: 20
4
+ ---
5
+
6
+ Ransack previously had documentation contained in a GitHub Wiki, and this content has been merged into this documentation website. The following long list of _amazing_ people all made contributions to the Wiki:
7
+
8
+ * Abinoam P. Marques Jr
9
+ * Alex Stophel
10
+ * Andrea Schiavini
11
+ * Andrew Vit
12
+ * Ben Koshy
13
+ * Brainkurv
14
+ * Brandan Lennox
15
+ * Brendon Muir
16
+ * Chris Salzberg
17
+ * Colleen McGuckin
18
+ * David Aldridge
19
+ * Davidson Mohanty
20
+ * Denis Tataurov
21
+ * Drew Moore
22
+ * Eike Send
23
+ * Feodor Cherashev
24
+ * Glauco Custódio
25
+ * Grey Baker
26
+ * Harold.Luo
27
+ * Herman Singh
28
+ * Ian Smith
29
+ * Jake Haber
30
+ * Jan Klimo
31
+ * Jared Beck
32
+ * Jon Atack
33
+ * Juanito Fatas
34
+ * JungaJk
35
+ * Leo Chen
36
+ * Leon Miller-Out
37
+ * Luca F
38
+ * Marc Poris
39
+ * Matt Oakley
40
+ * Michael Kopchick
41
+ * Nathan Colgate
42
+ * Nguyen Phi Viet(Sun*)
43
+ * Nguyễn Đức Long
44
+ * NielsKSchjoedt
45
+ * Patrick Copeland
46
+ * Pedro Chambino
47
+ * Rene Hopf
48
+ * Richa Arora
49
+ * Rob Jones
50
+ * Roman Sokhan
51
+ * Ryan Bates
52
+ * Ryan Bigg
53
+ * Sean
54
+ * Sean Linsley
55
+ * Sergey
56
+ * Sunny Ripert
57
+ * Tanbir Hasan
58
+ * ThuyNguyen97
59
+ * Vanda
60
+ * Yana Agun Siswanto
61
+ * bonyiii
62
+ * charly
63
+ * chifung7
64
+ * colorfulberry
65
+ * ddonahue99
66
+ * ernie
67
+ * gaaady
68
+ * gingerlime
69
+ * grumpit
70
+ * itsalongstory
71
+ * jonatack
72
+ * kogre
73
+ * nguyentrungson97
74
+ * nslocum
75
+ * omitter
76
+ * radar
77
+ * rilian
78
+ * terraplane
79
+ * tyronewilson
80
+ * vansy61
81
+ * willnet
82
+ * wzcolon
@@ -25,12 +25,11 @@ const config = {
25
25
  docs: {
26
26
  routeBasePath: '/',
27
27
  sidebarPath: require.resolve('./sidebars.js'),
28
- editUrl: 'https://github.com/activerecord-hackery/ransack/docs/docs/',
28
+ editUrl: 'https://github.com/activerecord-hackery/ransack/edit/main/docs/',
29
29
  },
30
30
  blog: {
31
31
  showReadingTime: true,
32
- editUrl:
33
- 'https://github.com/activerecord-hackery/ransack/docs/blog/',
32
+ editUrl: 'https://github.com/activerecord-hackery/ransack/edit/main/blog/',
34
33
  },
35
34
  theme: {
36
35
  customCss: require.resolve('./src/css/custom.css'),
data/docs/yarn.lock CHANGED
@@ -2347,9 +2347,9 @@ asap@~2.0.3:
2347
2347
  integrity sha1-5QNHYR1+aQlDIIu9r+vLwvuGbUY=
2348
2348
 
2349
2349
  async@^2.6.2:
2350
- version "2.6.3"
2351
- resolved "https://registry.yarnpkg.com/async/-/async-2.6.3.tgz#d72625e2344a3656e3a3ad4fa749fa83299d82ff"
2352
- integrity sha512-zflvls11DCy+dQWzTW2dzuilv8Z5X/pjfmZOWba6TNIVDm+2UDaJmXSOXlasHKfNBs8oo3M0aT50fDEWfKZjXg==
2350
+ version "2.6.4"
2351
+ resolved "https://registry.yarnpkg.com/async/-/async-2.6.4.tgz#706b7ff6084664cd7eae713f6f965433b5504221"
2352
+ integrity sha512-mzo5dfJYwAn29PeiJ0zvwTo04zj8HDJj0Mn8TD7sno7q12prdbnasKJHhkm2c1LgrhlJ0teaea8860oxi51mGA==
2353
2353
  dependencies:
2354
2354
  lodash "^4.17.14"
2355
2355
 
@@ -1 +1,11 @@
1
- require 'polyamorous/activerecord_6.0_ruby_2/reflection'
1
+ module Polyamorous
2
+ module ReflectionExtensions
3
+ def join_scope(table, foreign_table, foreign_klass)
4
+ if respond_to?(:polymorphic?) && polymorphic?
5
+ super.where!(foreign_table[foreign_type].eq(klass.name))
6
+ else
7
+ super
8
+ end
9
+ end
10
+ end
11
+ end
@@ -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'