ransack 3.0.0 → 4.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (80) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/codeql.yml +72 -0
  3. data/.github/workflows/deploy.yml +35 -0
  4. data/.github/workflows/test-deploy.yml +29 -0
  5. data/.github/workflows/test.yml +22 -39
  6. data/.rubocop.yml +3 -0
  7. data/CHANGELOG.md +118 -0
  8. data/CONTRIBUTING.md +38 -16
  9. data/Gemfile +10 -10
  10. data/README.md +9 -14
  11. data/bug_report_templates/test-ransacker-arel-present-predicate.rb +4 -0
  12. data/docs/.gitignore +0 -1
  13. data/docs/docs/getting-started/advanced-mode.md +1 -1
  14. data/docs/docs/getting-started/search-matches.md +1 -1
  15. data/docs/docs/getting-started/simple-mode.md +30 -26
  16. data/docs/docs/getting-started/sorting.md +1 -1
  17. data/docs/docs/getting-started/using-predicates.md +1 -1
  18. data/docs/docs/going-further/acts-as-taggable-on.md +114 -0
  19. data/docs/docs/going-further/documentation.md +14 -2
  20. data/docs/docs/going-further/exporting-to-csv.md +2 -2
  21. data/docs/docs/going-further/form-customisation.md +1 -1
  22. data/docs/docs/going-further/i18n.md +3 -3
  23. data/docs/docs/going-further/merging-searches.md +1 -1
  24. data/docs/docs/going-further/other-notes.md +1 -1
  25. data/docs/docs/going-further/polymorphic-search.md +40 -0
  26. data/docs/docs/going-further/saving-queries.md +1 -1
  27. data/docs/docs/going-further/searching-postgres.md +1 -1
  28. data/docs/docs/going-further/wiki-contributors.md +82 -0
  29. data/docs/docs/intro.md +2 -2
  30. data/docs/docusaurus.config.js +16 -4
  31. data/docs/package.json +7 -2
  32. data/docs/yarn.lock +3036 -1917
  33. data/lib/polyamorous/activerecord_6.1_ruby_2/reflection.rb +11 -1
  34. data/lib/polyamorous/activerecord_7.1_ruby_2/join_association.rb +1 -0
  35. data/lib/polyamorous/activerecord_7.1_ruby_2/join_dependency.rb +1 -0
  36. data/lib/polyamorous/activerecord_7.1_ruby_2/reflection.rb +1 -0
  37. data/lib/ransack/adapters/active_record/base.rb +78 -7
  38. data/lib/ransack/adapters/active_record/context.rb +17 -49
  39. data/lib/ransack/configuration.rb +25 -12
  40. data/lib/ransack/constants.rb +125 -3
  41. data/lib/ransack/context.rb +34 -5
  42. data/lib/ransack/helpers/form_builder.rb +3 -3
  43. data/lib/ransack/helpers/form_helper.rb +4 -3
  44. data/lib/ransack/nodes/attribute.rb +2 -2
  45. data/lib/ransack/nodes/condition.rb +80 -7
  46. data/lib/ransack/nodes/grouping.rb +3 -3
  47. data/lib/ransack/nodes/node.rb +1 -1
  48. data/lib/ransack/nodes/value.rb +2 -2
  49. data/lib/ransack/predicate.rb +1 -1
  50. data/lib/ransack/ransacker.rb +1 -1
  51. data/lib/ransack/search.rb +9 -4
  52. data/lib/ransack/translate.rb +2 -2
  53. data/lib/ransack/version.rb +1 -1
  54. data/lib/ransack/visitor.rb +38 -2
  55. data/lib/ransack.rb +3 -6
  56. data/ransack.gemspec +3 -3
  57. data/spec/helpers/polyamorous_helper.rb +2 -8
  58. data/spec/ransack/adapters/active_record/base_spec.rb +73 -0
  59. data/spec/ransack/configuration_spec.rb +9 -9
  60. data/spec/ransack/helpers/form_builder_spec.rb +8 -8
  61. data/spec/ransack/helpers/form_helper_spec.rb +60 -2
  62. data/spec/ransack/nodes/condition_spec.rb +24 -0
  63. data/spec/ransack/nodes/value_spec.rb +115 -0
  64. data/spec/ransack/predicate_spec.rb +36 -1
  65. data/spec/ransack/translate_spec.rb +1 -1
  66. data/spec/support/schema.rb +27 -10
  67. metadata +20 -21
  68. data/docs/package-lock.json +0 -9207
  69. data/lib/polyamorous/activerecord_6.0_ruby_2/join_association.rb +0 -20
  70. data/lib/polyamorous/activerecord_6.0_ruby_2/join_dependency.rb +0 -79
  71. data/lib/polyamorous/activerecord_6.0_ruby_2/reflection.rb +0 -11
  72. data/lib/polyamorous.rb +0 -1
  73. data/lib/ransack/adapters/active_record/ransack/constants.rb +0 -128
  74. data/lib/ransack/adapters/active_record/ransack/context.rb +0 -56
  75. data/lib/ransack/adapters/active_record/ransack/nodes/condition.rb +0 -69
  76. data/lib/ransack/adapters/active_record/ransack/translate.rb +0 -8
  77. data/lib/ransack/adapters/active_record/ransack/visitor.rb +0 -47
  78. data/lib/ransack/adapters.rb +0 -64
  79. data/lib/ransack/nodes.rb +0 -8
  80. /data/lib/ransack/{adapters/active_record.rb → active_record.rb} +0 -0
@@ -15,7 +15,7 @@ const config = {
15
15
  favicon: 'img/favicon.ico',
16
16
  organizationName: 'activerecord-hackery',
17
17
  projectName: 'ransack',
18
- trailingSlash: false,
18
+ trailingSlash: true,
19
19
 
20
20
  presets: [
21
21
  [
@@ -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'),
@@ -101,8 +100,21 @@ const config = {
101
100
  prism: {
102
101
  theme: lightCodeTheme,
103
102
  darkTheme: darkCodeTheme,
103
+ additionalLanguages: ['ruby', 'erb'],
104
104
  },
105
105
  }),
106
+
107
+ themes: [
108
+ [
109
+ require.resolve("@easyops-cn/docusaurus-search-local"),
110
+ {
111
+ // `hashed` is recommended as long-term-cache of index file is possible.
112
+ hashed: true,
113
+ // needs to be the same as routeBasePath in @docusaurus/preset-classic config
114
+ docsRouteBasePath: '/'
115
+ },
116
+ ]
117
+ ]
106
118
  };
107
119
 
108
120
  module.exports = config;
data/docs/package.json CHANGED
@@ -14,14 +14,19 @@
14
14
  "write-heading-ids": "docusaurus write-heading-ids"
15
15
  },
16
16
  "dependencies": {
17
- "@docusaurus/core": "2.0.0-beta.18",
18
- "@docusaurus/preset-classic": "2.0.0-beta.18",
17
+ "@docusaurus/core": "^2.2.0",
18
+ "@docusaurus/preset-classic": "^2.2.0",
19
+ "@easyops-cn/docusaurus-search-local": "^0.33.5",
19
20
  "@mdx-js/react": "^1.6.22",
20
21
  "clsx": "^1.1.1",
21
22
  "prism-react-renderer": "^1.3.1",
22
23
  "react": "^17.0.2",
23
24
  "react-dom": "^17.0.2"
24
25
  },
26
+ "resolutions": {
27
+ "trim": "^0.0.3",
28
+ "got": "^11.8.5"
29
+ },
25
30
  "browserslist": {
26
31
  "production": [
27
32
  ">0.5%",