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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 579a71fed1f35c24d51560f6055a00ab5d8072b6f2ff934e64a80363f86a6690
4
- data.tar.gz: 3d512392984fa15623c10c13dc06500a4f839966404f12849f55ce3cf894031b
3
+ metadata.gz: 5fca4f44cbc8415bd4747e0728dc748e9934398a39a49849a945e63d24bfea8c
4
+ data.tar.gz: c96b41b3989ecde608ad2a1e60a77a2fa4bbd5962f5a250588826384386a6be4
5
5
  SHA512:
6
- metadata.gz: 3d39a0aeeaaa0a9b5e07f6fa60b4e18b078d4cdae252565a984ad54980ffc1e08ec8d2abcf9dcf7f168999fa9f68f3c7cb0b272b2dcc96f2439f90e61429724e
7
- data.tar.gz: fc378916749f9802f668e61b303d86d563b2e910269cddc3b053770dca41ec1d2d5b71dbbd551756f76c90817a801bddf809e3c768ea62d60d9b9bbb716a0111
6
+ metadata.gz: 46dc0c8ea6775bd3756b682e1fa3f8847f11faf2a104b974db2abb0eb12d85f76a24ecaa438b66334e68e8fb81c0f9c179603a798db6799bdc3f55ea85230f55
7
+ data.tar.gz: 4f51211680c6190e3b59e062f56480b7dd28bb41586f0ddce2903d2edba8f9da1bbb9a75b708e7a0246b417b12c24f08cbf6219af35f46f7bb07bda883041f61
@@ -1,5 +1,5 @@
1
1
  class CreateIronSearchRecords < ActiveRecord::Migration[8.1]
2
- def up
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
- return unless connection.adapter_name == "SQLite"
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
@@ -1,3 +1,3 @@
1
1
  module Iron
2
- VERSION = "0.14.0"
2
+ VERSION = "0.14.1"
3
3
  end
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.0
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