apidae 2.1.0 → 2.1.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
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e24248296ca4edcff1a4f360921295e551fc2995a18cd1488143f88d6618312a
|
4
|
+
data.tar.gz: 11321235c809d393033bb88b2e8a9685e1e6b0563b4d9c10f49fed00d2ee7cf0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b8ba77cbaf8380a174e3d11ac6afd931a9841ae437a3be97c0e948509ac320a02dae01c563d111ae2fa4188112b506ed862d25b8df933e4236338deb0805fbc2
|
7
|
+
data.tar.gz: 3cbd3c08df1861633aaa6ba14be8ec93c8970adaeb9b1e29fb75aa563f4de565ea56eb0da32a61eba9012da8f0382020f6264148908c19c835d925a3cf7b2575
|
@@ -5,7 +5,11 @@ module Apidae
|
|
5
5
|
before_action :check_user_data!
|
6
6
|
|
7
7
|
def apidae_user
|
8
|
-
|
8
|
+
if Rails.application.config.respond_to?(:apidae_user)
|
9
|
+
Rails.application.config.apidae_user.respond_to?(:call) ? Rails.application.config.apidae_user.call : send(Rails.application.config.apidae_user)
|
10
|
+
else
|
11
|
+
nil
|
12
|
+
end
|
9
13
|
end
|
10
14
|
|
11
15
|
def user_is_admin?
|
@@ -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
|
-
|
95
|
-
|
96
|
-
|
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
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
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
|
|
data/lib/apidae/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: apidae
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.1.
|
4
|
+
version: 2.1.2
|
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-08-
|
11
|
+
date: 2025-08-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|