active_scaffold 4.0.11 → 4.0.13
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: 4fd3e750e0fb36959f8ac173dbb8f9ef3cffadaa1c4b7c7b66698ae97ae0da4e
|
4
|
+
data.tar.gz: 73ac2a464d935b187982282547440f450761d580cfd9e202601da5768670940a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5587b3cede0b77dfbc0194860fa7116f0f6e79ccc6647aa6e2a7f1a256bd107d19909c3b71d717497f7e0562fc6850ec3b829a7d27bc88ff4d24692125571639
|
7
|
+
data.tar.gz: a2d8672b60eb934851a1df4b57fb6928d1662e5924d6d78b1e06714db9e15ded2c48287d87382c4af2a1f1db0762b7e7d9b063ecfabc368ab4c66e322d246598
|
data/CHANGELOG.rdoc
CHANGED
@@ -1,3 +1,9 @@
|
|
1
|
+
= 4.0.13
|
2
|
+
- Fix security_methods on destroy_existing
|
3
|
+
|
4
|
+
= 4.0.12.2
|
5
|
+
- Filter includes for the selected model in select form_ui when column is a polymorphic association, as includes for polymorphic association may be a hash with the polymorphic association as key and associations of different models in the value
|
6
|
+
|
1
7
|
= 4.0.11
|
2
8
|
- Fix refresh_link with update_columns
|
3
9
|
|
@@ -144,8 +144,8 @@ module ActiveScaffold::Actions::Nested
|
|
144
144
|
unless config.action_links['destroy_existing']
|
145
145
|
config.action_links.add('destroy_existing', label: :remove, type: :member, confirm: :are_you_sure_to_delete,
|
146
146
|
method: :delete, position: false,
|
147
|
-
security_method: :
|
148
|
-
ignore_method: :
|
147
|
+
security_method: :delete_existing_authorized?,
|
148
|
+
ignore_method: :delete_existing_ignore?)
|
149
149
|
end
|
150
150
|
config.action_links['destroy'].ignore_method = :habtm_delete_ignore? if config.actions.include?(:delete)
|
151
151
|
end
|
@@ -36,8 +36,8 @@ module ActiveScaffold
|
|
36
36
|
relation = klass.where(conditions)
|
37
37
|
column = column_for_association(association, record)
|
38
38
|
if column&.includes
|
39
|
-
include_assoc = column
|
40
|
-
relation = relation.includes(include_assoc
|
39
|
+
include_assoc = includes_for_association(column, klass)
|
40
|
+
relation = relation.includes(include_assoc) if include_assoc
|
41
41
|
end
|
42
42
|
if column&.sort && column.sort&.dig(:sql)
|
43
43
|
# with threasafe enabled, column.sort[:sql] returns proxied strings and
|
@@ -49,6 +49,24 @@ module ActiveScaffold
|
|
49
49
|
end
|
50
50
|
end
|
51
51
|
|
52
|
+
def includes_for_association(column, klass)
|
53
|
+
includes = column.includes.find { |assoc| assoc.is_a?(Hash) && assoc.include?(column.association.name) }
|
54
|
+
return unless includes
|
55
|
+
|
56
|
+
includes = includes[column.association.name]
|
57
|
+
if column.association.polymorphic?
|
58
|
+
includes = Array.wrap(includes).filter_map do |assoc|
|
59
|
+
if assoc.is_a?(Hash)
|
60
|
+
assoc.select { |key, _| klass.reflect_on_association(key) }.presence
|
61
|
+
elsif klass.reflect_on_association(assoc)
|
62
|
+
assoc
|
63
|
+
end
|
64
|
+
end
|
65
|
+
end
|
66
|
+
|
67
|
+
includes.presence
|
68
|
+
end
|
69
|
+
|
52
70
|
def column_for_association(association, record)
|
53
71
|
active_scaffold_config_for(record.class).columns[association.name]
|
54
72
|
rescue StandardError => e
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: active_scaffold
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.0.
|
4
|
+
version: 4.0.13
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Many, see README
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-06-
|
11
|
+
date: 2025-06-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|