iron-cms 0.14.0 → 0.14.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 +4 -4
- data/db/migrate/20260210220330_create_iron_search_records.rb +2 -18
- data/lib/iron/engine.rb +0 -7
- data/lib/iron/version.rb +1 -1
- metadata +1 -2
- data/lib/iron/fts5.rb +0 -23
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 5fca4f44cbc8415bd4747e0728dc748e9934398a39a49849a945e63d24bfea8c
|
|
4
|
+
data.tar.gz: c96b41b3989ecde608ad2a1e60a77a2fa4bbd5962f5a250588826384386a6be4
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 46dc0c8ea6775bd3756b682e1fa3f8847f11faf2a104b974db2abb0eb12d85f76a24ecaa438b66334e68e8fb81c0f9c179603a798db6799bdc3f55ea85230f55
|
|
7
|
+
data.tar.gz: 4f51211680c6190e3b59e062f56480b7dd28bb41586f0ddce2903d2edba8f9da1bbb9a75b708e7a0246b417b12c24f08cbf6219af35f46f7bb07bda883041f61
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
class CreateIronSearchRecords < ActiveRecord::Migration[8.1]
|
|
2
|
-
def
|
|
2
|
+
def change
|
|
3
3
|
create_table :iron_search_records do |t|
|
|
4
4
|
t.references :entry, null: false, foreign_key: { to_table: :iron_entries }
|
|
5
5
|
t.references :locale, null: false, foreign_key: { to_table: :iron_locales }
|
|
@@ -10,22 +10,6 @@ class CreateIronSearchRecords < ActiveRecord::Migration[8.1]
|
|
|
10
10
|
t.index [ :entry_id, :locale_id ], unique: true
|
|
11
11
|
end
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
execute <<-SQL
|
|
16
|
-
CREATE VIRTUAL TABLE iron_search_records_fts USING fts5(
|
|
17
|
-
title,
|
|
18
|
-
content,
|
|
19
|
-
tokenize='porter'
|
|
20
|
-
)
|
|
21
|
-
SQL
|
|
22
|
-
end
|
|
23
|
-
|
|
24
|
-
def down
|
|
25
|
-
if connection.adapter_name == "SQLite"
|
|
26
|
-
execute "DROP TABLE IF EXISTS iron_search_records_fts"
|
|
27
|
-
end
|
|
28
|
-
|
|
29
|
-
drop_table :iron_search_records, if_exists: true
|
|
13
|
+
create_virtual_table :iron_search_records_fts, :fts5, [ "title", "content", "tokenize='porter'" ]
|
|
30
14
|
end
|
|
31
15
|
end
|
data/lib/iron/engine.rb
CHANGED
|
@@ -12,7 +12,6 @@ require "iron/sdk"
|
|
|
12
12
|
require "pagy"
|
|
13
13
|
require "iron/routing"
|
|
14
14
|
require "iron/image_analyzer"
|
|
15
|
-
require "iron/fts5"
|
|
16
15
|
|
|
17
16
|
module Iron
|
|
18
17
|
class Engine < ::Rails::Engine
|
|
@@ -59,12 +58,6 @@ module Iron
|
|
|
59
58
|
end
|
|
60
59
|
end
|
|
61
60
|
|
|
62
|
-
initializer "iron.fts5" do |app|
|
|
63
|
-
app.config.after_initialize do
|
|
64
|
-
ActiveSupport.on_load(:active_record) { Fts5.ensure_virtual_table }
|
|
65
|
-
end
|
|
66
|
-
end
|
|
67
|
-
|
|
68
61
|
config.to_prepare do
|
|
69
62
|
ActionView::Base.include(Module.new do
|
|
70
63
|
def attachment_url(attachment, **options)
|
data/lib/iron/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: iron-cms
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.14.
|
|
4
|
+
version: 0.14.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Massimo De Marchi
|
|
@@ -539,7 +539,6 @@ files:
|
|
|
539
539
|
- lib/iron-cms.rb
|
|
540
540
|
- lib/iron.rb
|
|
541
541
|
- lib/iron/engine.rb
|
|
542
|
-
- lib/iron/fts5.rb
|
|
543
542
|
- lib/iron/global_id/instance_scoped_locator.rb
|
|
544
543
|
- lib/iron/image_analyzer.rb
|
|
545
544
|
- lib/iron/lexorank.rb
|
data/lib/iron/fts5.rb
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
# SQLite FTS5 virtual tables are not captured by Rails' schema.rb dumper.
|
|
2
|
-
# When a database is created via db:schema:load (instead of running migrations),
|
|
3
|
-
# the FTS5 table will be missing. This ensures it exists on boot.
|
|
4
|
-
|
|
5
|
-
module Iron
|
|
6
|
-
module Fts5
|
|
7
|
-
def self.ensure_virtual_table
|
|
8
|
-
ActiveRecord::Base.connection_pool.with_connection do |conn|
|
|
9
|
-
return unless conn.adapter_name == "SQLite"
|
|
10
|
-
return unless conn.table_exists?(:iron_search_records)
|
|
11
|
-
return if conn.execute("SELECT name FROM sqlite_master WHERE type='table' AND name='iron_search_records_fts'").any?
|
|
12
|
-
|
|
13
|
-
conn.execute <<~SQL
|
|
14
|
-
CREATE VIRTUAL TABLE iron_search_records_fts USING fts5(
|
|
15
|
-
title,
|
|
16
|
-
content,
|
|
17
|
-
tokenize='porter'
|
|
18
|
-
)
|
|
19
|
-
SQL
|
|
20
|
-
end
|
|
21
|
-
end
|
|
22
|
-
end
|
|
23
|
-
end
|