kithe 2.6.1 → 2.7.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b4f768036d2b89fb4fedb4220b007e87f23967f9b81177cf4818fbd967f0b0d2
4
- data.tar.gz: 358cf6e4531c022160b4877e8ea7931a10930e71e2714f095bc0e52499fc6eee
3
+ metadata.gz: 9f8937387847f42ce3ae1327cd25ac029e38be0a5b821ef0dc45aeeef04d6de7
4
+ data.tar.gz: 1417b0de61a7a78e1f9ad8b162d766e667b52f89d18b87878390ffbd05b8011b
5
5
  SHA512:
6
- metadata.gz: 44139f3684a3609b16f972dffc58656bc2b110c6f6b5aefd635fc303089b30824a1351918ff704bcd48850bfb6cc95978bf2732ecda4166e8d9715ce9ab5ffee
7
- data.tar.gz: 6be86d9e1b234832bced241f1b4bf7a9badcc446fd3d1c00b617395864e833ddc2894e702b6ce2b41789d87fc310e1725818bc8b44d786666a5f3fe549fea6f5
6
+ metadata.gz: cfd282cf508978df374b23f51ee90f3389b5f5a061ad15a03bb12555776232c0bc8f9f825cc9ea9854dac0954528829d0eccc430aa76fb9eb30694c16f83fc84
7
+ data.tar.gz: 7d6833edbdb186b547d5d4f57e38fa39224ad797cbfd760c309d9a23bdb3ad8488b0c19aeb7cfe6f799ae946342f9e38172055df231e2a2272c992f6dc376333
data/README.md CHANGED
@@ -46,7 +46,7 @@ So you want to start an app that uses kithe. We should later provide better 'get
46
46
 
47
47
  * Kithe view support generally assumes your app uses bootstrap 4, and uses [simple form](https://github.com/plataformatec/simple_form) configured with bootstrap settings. See https://github.com/plataformatec/simple_form#bootstrap . So you should install simple_form and bootstrap 4.
48
48
 
49
- * Specific additional pre-requisites/requirements can sometimes be found in individual feature docs. And include the Javascript from [cocoon](https://github.com/nathanvda/cocoon), for form support for repeatable-field editing forms. We haven't quite figured out our preferred sane approach for sharing Javascript via kithe.
49
+ * Specific additional pre-requisites/requirements can sometimes be found in individual feature docs. And include the Javascript from [cocoon](https://github.com/nathanvda/cocoon), for form support for repeatable-field editing forms. (Only needs cocoon-compatible javascript, so you can use via NPM package without actually using the cocoon gem!)
50
50
 
51
51
 
52
52
  ## Why kithe?
data/lib/kithe/engine.rb CHANGED
@@ -15,6 +15,25 @@ require "kithe/config_base"
15
15
 
16
16
  module Kithe
17
17
  class Engine < ::Rails::Engine
18
+
19
+ # Rails Single-table-inheritance auto-load workaround, further worked around
20
+ # for Rails 7.
21
+ #
22
+ # https://github.com/rails/rails/issues/46625
23
+ # https://github.com/rails/rails/issues/45307
24
+ #
25
+ # Descendants wont' be pre-loaded during initialization, but this is the best
26
+ # we can do.
27
+ initializer ("kithe.preload_single_table_inheritance") do
28
+ unless false && Rails.configuration.cache_classes && Rails.configuration.eager_load
29
+ Rails.configuration.to_prepare do
30
+ Kithe::Model.preload_sti unless Kithe::Model.preloaded
31
+ rescue ActiveRecord::NoDatabaseError, ActiveRecord::StatementInvalid => e
32
+ Rails.logger.debug("Could not pre-load Kithe::Models Single-Table Inheritance descendents: #{e.inspect}")
33
+ end
34
+ end
35
+ end
36
+
18
37
  config.generators do |g|
19
38
  g.test_framework :rspec, :fixture => false
20
39
  g.fixture_replacement :factory_bot, :dir => 'spec/factories'
@@ -8,8 +8,13 @@ module Kithe
8
8
  # on particular inheritance hieararchies.
9
9
  #
10
10
  # We include in our Kithe::Model, which uses Single-Table Inheritance
11
+ #
12
+ # BUT NOTE: What's in Rails Guide right now actually breaks in Rails 7.
13
+ #
14
+ # We've messed with based on https://github.com/rails/rails/issues/45307 et al.
15
+ #
11
16
  module StiPreload
12
- unless Rails.application.config.eager_load
17
+ unless Rails.configuration.cache_classes && Rails.configuration.eager_load
13
18
  extend ActiveSupport::Concern
14
19
 
15
20
  included do
@@ -17,10 +22,13 @@ module Kithe
17
22
  end
18
23
 
19
24
  class_methods do
20
- def descendants
21
- preload_sti unless preloaded
22
- super
23
- end
25
+
26
+ # For Rails 7, this now breaks; we work around with an after_initialize hook
27
+ # in ./kithe/engine.rb . See more links there.
28
+ # def descendants
29
+ # preload_sti unless preloaded
30
+ # super
31
+ # end
24
32
 
25
33
  # Constantizes all types present in the database. There might be more on
26
34
  # disk, but that does not matter in practice as far as the STI API is
data/lib/kithe/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Kithe
2
- VERSION = '2.6.1'
2
+ VERSION = '2.7.0'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kithe
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.6.1
4
+ version: 2.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jonathan Rochkind
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-08-23 00:00:00.000000000 Z
11
+ date: 2022-12-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -426,7 +426,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
426
426
  - !ruby/object:Gem::Version
427
427
  version: '0'
428
428
  requirements: []
429
- rubygems_version: 3.3.20
429
+ rubygems_version: 3.2.33
430
430
  signing_key:
431
431
  specification_version: 4
432
432
  summary: Shareable tools/components for building a digital collections app in Rails.