apidae 2.0.6 → 2.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5dbd0282d2b8686bbee8af98ff9b4f6450508f0fa69aa7c56815fa7ff9f42042
4
- data.tar.gz: 6746be2e303e035f50769ba3f73d11145388827cd299f5d63a7fb77f51ae4c21
3
+ metadata.gz: aad214b7100d75cda0a1f617c9fb28577271384563a401e88e0495a610e6aeb4
4
+ data.tar.gz: 81238337e264ed04bec2ef961716ec37dafaa61340b23910d72d93a2efe7f45c
5
5
  SHA512:
6
- metadata.gz: 373288df62810351691dd344a6a5a54c9da4d30b94bba50e770ea03611b75803a8d930711498221403108b6e751180e0c16ee9926a185107a886fdade4cdb5e2
7
- data.tar.gz: cfcd958bcb1787f47d56852331a67f6793dc9583a19e83ad5d3cc0dcd7460cbd0567771b93a6c8b23bfa1a593fe68040d207028d5898aae6972bdcdcf72efedf
6
+ metadata.gz: e015255a09cba0290f1804d337f4d2444c6f4a33d4e425e6806d57c9636b9d634f0f07aa879ee990eb7ac1d9e9ef69b296f5463e6e5f7a3aa722d9085f029b2d
7
+ data.tar.gz: 1713869c72c8c7be44e7004f7beafdf46a428d72bb6b9a7d0e5ad843173e0b1e0fe2923709044b0e3c66a04024182b5d2c3f1fe648a4a54bca94e1446a3a4492
@@ -3,7 +3,7 @@ require_dependency "apidae/application_controller"
3
3
  module Apidae
4
4
  class ObjectsController < ApplicationController
5
5
  before_action :set_object, only: [:show, :edit, :update, :destroy, :refresh]
6
- skip_before_action Rails.application.config.apidae_auth, only: [:index, :show], :if => Proc.new {|c| c.request.format.json?}
6
+ skip_before_action Rails.application.config.apidae_auth, only: [:index, :show, :search], :if => Proc.new {|c| c.request.format.json?}
7
7
 
8
8
  def index
9
9
  session[:referrer] = request.referrer
@@ -84,15 +84,20 @@ module Apidae
84
84
  @results = PgSearch::Document.tsv_search(params[:query])
85
85
  .joins("INNER JOIN apidae_selection_objects AS aso ON (aso.apidae_object_id = pg_search_documents.searchable_id) AND pg_search_documents.searchable_type = 'Apidae::Obj'")
86
86
  .where("aso.apidae_selection_id IN (?)", user_selections)
87
+ respond_to do |format|
88
+ format.html
89
+ format.json { render json: @results }
90
+ end
87
91
  end
88
92
 
89
93
  private
90
- def set_object
91
- @obj = Obj.find(params[:id])
92
- end
93
94
 
94
- def object_params
95
- params.require(:obj).permit!
96
- end
95
+ def set_object
96
+ @obj = Obj.find(params[:id])
97
+ end
98
+
99
+ def object_params
100
+ params.require(:obj).permit!
101
+ end
97
102
  end
98
103
  end
@@ -2,12 +2,13 @@ class AlterTsvColumnInPgSearchDocuments < ActiveRecord::Migration[7.2]
2
2
  def up
3
3
  execute <<-SQL
4
4
  ALTER TABLE pg_search_documents DROP COLUMN IF EXISTS tsv_content;
5
- ADD COLUMN tsv_content tsvector GENERATED ALWAYS AS (
6
- setweight(to_tsvector('fr', coalesce(split_part(coalesce(content, ''), '§§§', 1), '')), 'A') ||
7
- setweight(to_tsvector('fr', coalesce(split_part(coalesce(content, ''), '§§§', 2), '')), 'B') ||
8
- setweight(to_tsvector('fr', coalesce(split_part(coalesce(content, ''), '§§§', 3), '')), 'C') ||
9
- setweight(to_tsvector('fr', coalesce(split_part(coalesce(content, ''), '§§§', 4), '')), 'D') ||
10
- ) STORED;
5
+ ALTER TABLE pg_search_documents
6
+ ADD COLUMN tsv_content tsvector GENERATED ALWAYS AS (
7
+ setweight(to_tsvector('fr', coalesce(split_part(coalesce(content, ''), '§§§', 1), '')), 'A') ||
8
+ setweight(to_tsvector('fr', coalesce(split_part(coalesce(content, ''), '§§§', 2), '')), 'B') ||
9
+ setweight(to_tsvector('fr', coalesce(split_part(coalesce(content, ''), '§§§', 3), '')), 'C') ||
10
+ setweight(to_tsvector('fr', coalesce(split_part(coalesce(content, ''), '§§§', 4), '')), 'D')
11
+ ) STORED;
11
12
  SQL
12
13
  end
13
14
 
@@ -1,3 +1,3 @@
1
1
  module Apidae
2
- VERSION = "2.0.6"
2
+ VERSION = "2.1.1"
3
3
  end
metadata CHANGED
@@ -1,27 +1,27 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: apidae
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.6
4
+ version: 2.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jean-Baptiste Vilain
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-05-14 00:00:00.000000000 Z
11
+ date: 2025-08-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
19
  version: '7.0'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - "~>"
24
+ - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: '7.0'
27
27
  - !ruby/object:Gem::Dependency