ransack 2.3.2 → 4.1.1

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.
Files changed (145) hide show
  1. checksums.yaml +4 -4
  2. data/.github/FUNDING.yml +3 -0
  3. data/.github/SECURITY.md +12 -0
  4. data/.github/workflows/codeql.yml +72 -0
  5. data/.github/workflows/cronjob.yml +99 -0
  6. data/.github/workflows/deploy.yml +35 -0
  7. data/.github/workflows/rubocop.yml +20 -0
  8. data/.github/workflows/test-deploy.yml +29 -0
  9. data/.github/workflows/test.yml +131 -0
  10. data/.nojekyll +0 -0
  11. data/.rubocop.yml +50 -0
  12. data/CHANGELOG.md +251 -1
  13. data/CONTRIBUTING.md +51 -29
  14. data/Gemfile +12 -10
  15. data/README.md +45 -907
  16. data/bug_report_templates/test-ransack-scope-and-column-same-name.rb +78 -0
  17. data/bug_report_templates/test-ransacker-arel-present-predicate.rb +75 -0
  18. data/docs/.gitignore +19 -0
  19. data/docs/.nojekyll +0 -0
  20. data/docs/babel.config.js +3 -0
  21. data/docs/blog/2022-03-27-ransack-3.0.0.md +20 -0
  22. data/docs/docs/getting-started/_category_.json +4 -0
  23. data/docs/docs/getting-started/advanced-mode.md +46 -0
  24. data/docs/docs/getting-started/configuration.md +47 -0
  25. data/docs/docs/getting-started/search-matches.md +67 -0
  26. data/docs/docs/getting-started/simple-mode.md +288 -0
  27. data/docs/docs/getting-started/sorting.md +71 -0
  28. data/docs/docs/getting-started/using-predicates.md +282 -0
  29. data/docs/docs/going-further/_category_.json +4 -0
  30. data/docs/docs/going-further/acts-as-taggable-on.md +114 -0
  31. data/docs/docs/going-further/associations.md +70 -0
  32. data/docs/docs/going-further/custom-predicates.md +52 -0
  33. data/docs/docs/going-further/documentation.md +43 -0
  34. data/docs/docs/going-further/exporting-to-csv.md +49 -0
  35. data/docs/docs/going-further/external-guides.md +57 -0
  36. data/docs/docs/going-further/form-customisation.md +63 -0
  37. data/docs/docs/going-further/i18n.md +53 -0
  38. data/docs/docs/going-further/img/create_release.png +0 -0
  39. data/docs/docs/going-further/merging-searches.md +41 -0
  40. data/docs/docs/going-further/other-notes.md +428 -0
  41. data/docs/docs/going-further/polymorphic-search.md +46 -0
  42. data/docs/docs/going-further/ransackers.md +331 -0
  43. data/docs/docs/going-further/release_process.md +36 -0
  44. data/docs/docs/going-further/saving-queries.md +82 -0
  45. data/docs/docs/going-further/searching-postgres.md +57 -0
  46. data/docs/docs/going-further/wiki-contributors.md +82 -0
  47. data/docs/docs/intro.md +99 -0
  48. data/docs/docusaurus.config.js +120 -0
  49. data/docs/package.json +42 -0
  50. data/docs/sidebars.js +31 -0
  51. data/docs/src/components/HomepageFeatures/index.js +64 -0
  52. data/docs/src/components/HomepageFeatures/styles.module.css +11 -0
  53. data/docs/src/css/custom.css +39 -0
  54. data/docs/src/pages/index.module.css +23 -0
  55. data/docs/src/pages/markdown-page.md +7 -0
  56. data/docs/static/.nojekyll +0 -0
  57. data/docs/static/img/docusaurus.png +0 -0
  58. data/docs/static/img/favicon.ico +0 -0
  59. data/docs/static/img/logo.svg +1 -0
  60. data/docs/static/img/tutorial/docsVersionDropdown.png +0 -0
  61. data/docs/static/img/tutorial/localeDropdown.png +0 -0
  62. data/docs/static/img/undraw_docusaurus_mountain.svg +171 -0
  63. data/docs/static/img/undraw_docusaurus_react.svg +170 -0
  64. data/docs/static/img/undraw_docusaurus_tree.svg +40 -0
  65. data/docs/yarn.lock +8879 -0
  66. data/lib/polyamorous/activerecord/join_association.rb +70 -0
  67. data/{polyamorous/lib/polyamorous/activerecord_6.0_ruby_2 → lib/polyamorous/activerecord}/join_dependency.rb +33 -12
  68. data/lib/polyamorous/activerecord/reflection.rb +11 -0
  69. data/{polyamorous/lib → lib/polyamorous}/polyamorous.rb +3 -4
  70. data/lib/ransack/adapters/active_record/base.rb +83 -10
  71. data/lib/ransack/adapters/active_record/context.rb +56 -44
  72. data/lib/ransack/configuration.rb +53 -10
  73. data/lib/ransack/constants.rb +126 -4
  74. data/lib/ransack/context.rb +34 -5
  75. data/lib/ransack/helpers/form_builder.rb +6 -6
  76. data/lib/ransack/helpers/form_helper.rb +14 -5
  77. data/lib/ransack/helpers.rb +1 -1
  78. data/lib/ransack/locale/sv.yml +70 -0
  79. data/lib/ransack/nodes/attribute.rb +3 -3
  80. data/lib/ransack/nodes/condition.rb +80 -9
  81. data/lib/ransack/nodes/grouping.rb +4 -4
  82. data/lib/ransack/nodes/node.rb +1 -1
  83. data/lib/ransack/nodes/sort.rb +3 -3
  84. data/lib/ransack/nodes/value.rb +3 -3
  85. data/lib/ransack/predicate.rb +1 -1
  86. data/lib/ransack/ransacker.rb +1 -1
  87. data/lib/ransack/search.rb +15 -7
  88. data/lib/ransack/translate.rb +6 -6
  89. data/lib/ransack/version.rb +1 -1
  90. data/lib/ransack/visitor.rb +38 -2
  91. data/lib/ransack.rb +5 -8
  92. data/ransack.gemspec +9 -15
  93. data/spec/blueprints/articles.rb +1 -1
  94. data/spec/blueprints/comments.rb +1 -1
  95. data/spec/blueprints/notes.rb +1 -1
  96. data/spec/blueprints/tags.rb +1 -1
  97. data/spec/console.rb +5 -5
  98. data/spec/helpers/polyamorous_helper.rb +2 -8
  99. data/spec/helpers/ransack_helper.rb +1 -1
  100. data/spec/polyamorous/activerecord_compatibility_spec.rb +15 -0
  101. data/spec/{ransack → polyamorous}/join_association_spec.rb +3 -1
  102. data/spec/{ransack → polyamorous}/join_dependency_spec.rb +0 -16
  103. data/spec/ransack/adapters/active_record/base_spec.rb +125 -16
  104. data/spec/ransack/adapters/active_record/context_spec.rb +19 -18
  105. data/spec/ransack/configuration_spec.rb +33 -9
  106. data/spec/ransack/helpers/form_builder_spec.rb +8 -8
  107. data/spec/ransack/helpers/form_helper_spec.rb +109 -20
  108. data/spec/ransack/nodes/condition_spec.rb +37 -0
  109. data/spec/ransack/nodes/grouping_spec.rb +2 -2
  110. data/spec/ransack/nodes/value_spec.rb +115 -0
  111. data/spec/ransack/predicate_spec.rb +37 -2
  112. data/spec/ransack/search_spec.rb +238 -30
  113. data/spec/ransack/translate_spec.rb +1 -1
  114. data/spec/spec_helper.rb +7 -5
  115. data/spec/support/schema.rb +108 -11
  116. metadata +98 -62
  117. data/.travis.yml +0 -47
  118. data/lib/ransack/adapters/active_record/ransack/constants.rb +0 -128
  119. data/lib/ransack/adapters/active_record/ransack/context.rb +0 -55
  120. data/lib/ransack/adapters/active_record/ransack/nodes/condition.rb +0 -61
  121. data/lib/ransack/adapters/active_record/ransack/translate.rb +0 -8
  122. data/lib/ransack/adapters/active_record/ransack/visitor.rb +0 -47
  123. data/lib/ransack/adapters.rb +0 -64
  124. data/lib/ransack/nodes.rb +0 -8
  125. data/polyamorous/lib/polyamorous/activerecord_5.2_ruby_2/join_association.rb +0 -20
  126. data/polyamorous/lib/polyamorous/activerecord_5.2_ruby_2/join_dependency.rb +0 -79
  127. data/polyamorous/lib/polyamorous/activerecord_5.2_ruby_2/reflection.rb +0 -12
  128. data/polyamorous/lib/polyamorous/activerecord_6.0_ruby_2/join_association.rb +0 -2
  129. data/polyamorous/lib/polyamorous/activerecord_6.0_ruby_2/reflection.rb +0 -2
  130. data/polyamorous/lib/polyamorous/activerecord_6.1_ruby_2/join_association.rb +0 -2
  131. data/polyamorous/lib/polyamorous/activerecord_6.1_ruby_2/join_dependency.rb +0 -2
  132. data/polyamorous/lib/polyamorous/activerecord_6.1_ruby_2/reflection.rb +0 -2
  133. data/polyamorous/lib/polyamorous/version.rb +0 -3
  134. data/polyamorous/polyamorous.gemspec +0 -27
  135. /data/{logo → docs/static/logo}/ransack-h.png +0 -0
  136. /data/{logo → docs/static/logo}/ransack-h.svg +0 -0
  137. /data/{logo → docs/static/logo}/ransack-v.png +0 -0
  138. /data/{logo → docs/static/logo}/ransack-v.svg +0 -0
  139. /data/{logo → docs/static/logo}/ransack.png +0 -0
  140. /data/{logo → docs/static/logo}/ransack.svg +0 -0
  141. /data/{polyamorous/lib → lib}/polyamorous/join.rb +0 -0
  142. /data/{polyamorous/lib → lib}/polyamorous/swapping_reflection_class.rb +0 -0
  143. /data/{polyamorous/lib → lib}/polyamorous/tree_node.rb +0 -0
  144. /data/lib/ransack/{adapters/active_record.rb → active_record.rb} +0 -0
  145. /data/spec/{ransack → polyamorous}/join_spec.rb +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: bffef7e72f7a8e247d02c8f08fdca3234be7be51c1c6bb8d02fe23e194ff440e
4
- data.tar.gz: 0b33224e20bd71a3f0915c2346403e35b61f6eae6adaa159bb21048cf874be66
3
+ metadata.gz: dbeb7a329e22aabf90d2336f563ebfa162e0fa4a085fa5271896ed106d2d6612
4
+ data.tar.gz: e65a2f50206b930faaf7d5fd554830c553fc0050777f98f493de8e99940e3c78
5
5
  SHA512:
6
- metadata.gz: '075369a8203e72ec979755e47157876db98861ec41a0ac419bf8c10bec16369566cc40214d70d707a285ffc646a9afb66aa4849a88ae2a031b44d481de9348d3'
7
- data.tar.gz: '0381f3b76f64fa38eb28f02e2fbe35e47224a56cc18e5bb0b93db8581e6f85b200836c678066f98797633874df161a96e87d09e18583e362c0b5a96a02839482'
6
+ metadata.gz: 1c0ece8ec2de53c780769d572369442c93b0c4769fe8394baa32ad87d4ae2b7a2fdc66b2f1227499b7a07df80f24d3cf0671a72a33c988fe43c926e37a42dbe1
7
+ data.tar.gz: fa6ba91dab6d66369595b8ddee0e46c80b5f1103ca179f67c0be75f78109555a15f784448441fb04c9d8f3afba92c04e56962d77eb4cc4870cff0ecc61f49a1e
@@ -0,0 +1,3 @@
1
+ ---
2
+
3
+ tidelift: rubygems/ransack
@@ -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,72 @@
1
+ # For most projects, this workflow file will not need changing; you simply need
2
+ # to commit it to your repository.
3
+ #
4
+ # You may wish to alter this file to override the set of languages analyzed,
5
+ # or to provide custom queries or build logic.
6
+ #
7
+ # ******** NOTE ********
8
+ # We have attempted to detect the languages in your repository. Please check
9
+ # the `language` matrix defined below to confirm you have the correct set of
10
+ # supported CodeQL languages.
11
+ #
12
+ name: "CodeQL"
13
+
14
+ on:
15
+ push:
16
+ branches: [ main ]
17
+ pull_request:
18
+ # The branches below must be a subset of the branches above
19
+ branches: [ main ]
20
+ schedule:
21
+ - cron: '43 11 * * 3'
22
+
23
+ jobs:
24
+ analyze:
25
+ name: Analyze
26
+ runs-on: ubuntu-latest
27
+ permissions:
28
+ actions: read
29
+ contents: read
30
+ security-events: write
31
+
32
+ strategy:
33
+ fail-fast: false
34
+ matrix:
35
+ language: [ 'ruby' ]
36
+ # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
37
+ # Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support
38
+
39
+ steps:
40
+ - name: Checkout repository
41
+ uses: actions/checkout@v3
42
+
43
+ # Initializes the CodeQL tools for scanning.
44
+ - name: Initialize CodeQL
45
+ uses: github/codeql-action/init@v2
46
+ with:
47
+ languages: ${{ matrix.language }}
48
+ # If you wish to specify custom queries, you can do so here or in a config file.
49
+ # By default, queries listed here will override any specified in a config file.
50
+ # Prefix the list here with "+" to use these queries and those in the config file.
51
+
52
+ # Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
53
+ # queries: security-extended,security-and-quality
54
+
55
+
56
+ # Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
57
+ # If this step fails, then you should remove it and run the build manually (see below)
58
+ - name: Autobuild
59
+ uses: github/codeql-action/autobuild@v2
60
+
61
+ # ℹ️ Command-line programs to run using the OS shell.
62
+ # 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
63
+
64
+ # If the Autobuild fails above, remove it and uncomment the following three lines.
65
+ # modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.
66
+
67
+ # - run: |
68
+ # echo "Run, Build Application using script"
69
+ # ./location_of_script_within_repo/buildscript.sh
70
+
71
+ - name: Perform CodeQL Analysis
72
+ uses: github/codeql-action/analyze@v2
@@ -0,0 +1,99 @@
1
+ name: cronjob
2
+
3
+ on:
4
+ schedule:
5
+ - cron: "0 0 * * *"
6
+
7
+ jobs:
8
+ sqlite3:
9
+ runs-on: ubuntu-22.04
10
+ strategy:
11
+ fail-fast: false
12
+ matrix:
13
+ ruby:
14
+ - 3.2.2
15
+ env:
16
+ DB: sqlite3
17
+ RAILS: main
18
+ steps:
19
+ - uses: actions/checkout@v2
20
+ - name: Set up Ruby
21
+ uses: ruby/setup-ruby@v1
22
+ with:
23
+ ruby-version: ${{ matrix.ruby }}
24
+ - name: Install dependencies
25
+ run: bundle install
26
+ - name: Run tests
27
+ run: bundle exec rspec
28
+
29
+ mysql:
30
+ runs-on: ubuntu-22.04
31
+ strategy:
32
+ fail-fast: false
33
+ matrix:
34
+ ruby:
35
+ - 3.2.2
36
+ env:
37
+ DB: mysql
38
+ RAILS: main
39
+ MYSQL_USERNAME: root
40
+ MYSQL_PASSWORD: root
41
+ steps:
42
+ - uses: actions/checkout@v2
43
+ - name: Set up Ruby
44
+ uses: ruby/setup-ruby@v1
45
+ with:
46
+ ruby-version: ${{ matrix.ruby }}
47
+ - name: Startup MySQL
48
+ run: |
49
+ sudo systemctl start mysql.service
50
+ - name: Setup databases
51
+ run: |
52
+ mysql --user=root --password=root --host=127.0.0.1 -e 'create database ransack collate utf8_general_ci;';
53
+ mysql --user=root --password=root --host=127.0.0.1 -e 'use ransack;show variables like "%character%";show variables like "%collation%";';
54
+ - name: Install dependencies
55
+ run: bundle install
56
+ - name: Run tests
57
+ run: bundle exec rspec
58
+
59
+ postgres:
60
+ runs-on: ubuntu-22.04
61
+ strategy:
62
+ fail-fast: false
63
+ matrix:
64
+ ruby:
65
+ - 3.2.2
66
+ env:
67
+ DB: postgres
68
+ RAILS: main
69
+ DATABASE_USERNAME: postgres
70
+ DATABASE_PASSWORD: postgres
71
+ DATABASE_HOST: 127.0.0.1
72
+ services:
73
+ postgres:
74
+ image: postgres
75
+ ports:
76
+ - 5432:5432
77
+ env:
78
+ POSTGRES_PASSWORD: postgres
79
+ POSTGRES_HOST_AUTH_METHOD: trust
80
+ # Set health checks to wait until postgres has started
81
+ options: >-
82
+ --health-cmd pg_isready
83
+ --health-interval 10s
84
+ --health-timeout 5s
85
+ --health-retries 5
86
+
87
+ steps:
88
+ - uses: actions/checkout@v2
89
+ - name: Set up Ruby
90
+ uses: ruby/setup-ruby@v1
91
+ with:
92
+ ruby-version: ${{ matrix.ruby }}
93
+ - name: Setup databases
94
+ run: |
95
+ psql -h localhost -p 5432 -W postgres -c 'create database ransack;' -U postgres;
96
+ - name: Install dependencies
97
+ run: bundle install
98
+ - name: Run tests
99
+ run: bundle exec rspec
@@ -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-22.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,20 @@
1
+ name: rubocop
2
+
3
+ on:
4
+ push:
5
+ pull_request:
6
+
7
+ jobs:
8
+ build:
9
+ runs-on: ubuntu-22.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.2.2
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,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-22.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
@@ -0,0 +1,131 @@
1
+ name: test
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - main
7
+ pull_request:
8
+
9
+ jobs:
10
+ sqlite3:
11
+ runs-on: ubuntu-22.04
12
+ strategy:
13
+ fail-fast: false
14
+ matrix:
15
+ rails:
16
+ - v7.1.0
17
+ - v7.0.3
18
+ - v6.1.6
19
+ ruby:
20
+ - 3.2.2
21
+ - 3.1.4
22
+ - 3.0.6
23
+ env:
24
+ DB: sqlite3
25
+ RAILS: ${{ matrix.rails }}
26
+ steps:
27
+ - uses: actions/checkout@v2
28
+ - name: Set up Ruby
29
+ uses: ruby/setup-ruby@v1
30
+ with:
31
+ ruby-version: ${{ matrix.ruby }}
32
+ bundler-cache: true
33
+ - name: Run tests
34
+ run: bundle exec rspec
35
+
36
+ mysql:
37
+ runs-on: ubuntu-22.04
38
+ strategy:
39
+ fail-fast: false
40
+ matrix:
41
+ rails:
42
+ - v7.1.0
43
+ - v7.0.3
44
+ - v6.1.6
45
+ ruby:
46
+ - 3.2.2
47
+ - 3.1.4
48
+ - 3.0.6
49
+ env:
50
+ DB: mysql
51
+ RAILS: ${{ matrix.rails }}
52
+ MYSQL_USERNAME: root
53
+ MYSQL_PASSWORD: root
54
+ steps:
55
+ - uses: actions/checkout@v2
56
+ - name: Set up Ruby
57
+ uses: ruby/setup-ruby@v1
58
+ with:
59
+ ruby-version: ${{ matrix.ruby }}
60
+ bundler-cache: true
61
+ - name: Startup MySQL
62
+ run: |
63
+ sudo systemctl start mysql.service
64
+ - name: Setup databases
65
+ run: |
66
+ mysql --user=root --password=root --host=127.0.0.1 -e 'create database ransack collate utf8_general_ci;';
67
+ mysql --user=root --password=root --host=127.0.0.1 -e 'use ransack;show variables like "%character%";show variables like "%collation%";';
68
+ - name: Run tests
69
+ run: bundle exec rspec
70
+
71
+ postgres:
72
+ runs-on: ubuntu-22.04
73
+ strategy:
74
+ fail-fast: false
75
+ matrix:
76
+ rails:
77
+ - v7.1.0
78
+ - v7.0.3
79
+ - v6.1.6
80
+ ruby:
81
+ - 3.2.2
82
+ - 3.1.4
83
+ - 3.0.6
84
+ env:
85
+ DB: postgres
86
+ RAILS: ${{ matrix.rails }}
87
+ DATABASE_USERNAME: postgres
88
+ DATABASE_PASSWORD: postgres
89
+ DATABASE_HOST: 127.0.0.1
90
+ services:
91
+ postgres:
92
+ image: postgres
93
+ ports:
94
+ - 5432:5432
95
+ env:
96
+ POSTGRES_PASSWORD: postgres
97
+ POSTGRES_HOST_AUTH_METHOD: trust
98
+ # Set health checks to wait until postgres has started
99
+ options: >-
100
+ --health-cmd pg_isready
101
+ --health-interval 10s
102
+ --health-timeout 5s
103
+ --health-retries 5
104
+
105
+ steps:
106
+ - uses: actions/checkout@v2
107
+ - name: Set up Ruby
108
+ uses: ruby/setup-ruby@v1
109
+ with:
110
+ ruby-version: ${{ matrix.ruby }}
111
+ bundler-cache: true
112
+ - name: Setup databases
113
+ run: |
114
+ psql -h localhost -p 5432 -W postgres -c 'create database ransack;' -U postgres;
115
+ - name: Run tests
116
+ run: bundle exec rspec
117
+
118
+ bug-report-templates:
119
+ runs-on: ubuntu-22.04
120
+ steps:
121
+ - uses: actions/checkout@v2
122
+ - name: Set up Ruby
123
+ uses: ruby/setup-ruby@v1
124
+ with:
125
+ ruby-version: 3.2.2
126
+ bundler-cache: true
127
+ - name: Run bug report templates
128
+ run: |
129
+ ruby bug_report_templates/test-ransacker-arel-present-predicate.rb
130
+ ruby bug_report_templates/test-ransack-scope-and-column-same-name.rb
131
+ rm Gemfile Gemfile.lock
data/.nojekyll ADDED
File without changes
data/.rubocop.yml ADDED
@@ -0,0 +1,50 @@
1
+ AllCops:
2
+ TargetRubyVersion: 3.0
3
+
4
+ DisabledByDefault: true
5
+
6
+ Exclude:
7
+ - "docs/**/*"
8
+
9
+ Layout/EmptyLineAfterMagicComment:
10
+ Enabled: true
11
+
12
+ Layout/EmptyLineBetweenDefs:
13
+ Enabled: true
14
+
15
+ Layout/EmptyLines:
16
+ Enabled: true
17
+
18
+ Layout/FirstArrayElementIndentation:
19
+ EnforcedStyle: consistent
20
+
21
+ Layout/SpaceAfterComma:
22
+ Enabled: true
23
+
24
+ Layout/SpaceInsideBlockBraces:
25
+ Enabled: true
26
+
27
+ Layout/SpaceInsideHashLiteralBraces:
28
+ Enabled: true
29
+
30
+ Layout/SpaceInsideParens:
31
+ Enabled: true
32
+
33
+ Layout/TrailingEmptyLines:
34
+ Enabled: true
35
+
36
+ Style/HashSyntax:
37
+ Enabled: true
38
+
39
+ Style/RedundantFileExtensionInRequire:
40
+ Enabled: true
41
+
42
+ Style/RedundantReturn:
43
+ Enabled: true
44
+
45
+ Style/SelfAssignment:
46
+ Enabled: true
47
+
48
+ Style/Semicolon:
49
+ Enabled: true
50
+