active_scaffold 3.7.11.1 → 3.7.12
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/CHANGELOG.rdoc +4 -0
- data/lib/active_scaffold/actions/core.rb +1 -1
- data/lib/active_scaffold/attribute_params.rb +2 -1
- data/lib/active_scaffold/config/field_search.rb +7 -1
- data/lib/active_scaffold/helpers/search_column_helpers.rb +4 -2
- data/lib/active_scaffold/version.rb +2 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0ab6174a908369ed7071d91754c982eb08404643e4fb4df6e8f1a5671ba2671d
|
4
|
+
data.tar.gz: 4dc900e33aeebc279e50d0cf2db26a327c241b84fc4c3cace3a5da981151dba4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d4c3ae4876dfcd281c0d1b676c7af0eee264745fbbc3509f400eb54d46bdc2c08e707536eb6753dfe31387a877f5a8929975c20ab017bc7d9e503764f4c6f14c
|
7
|
+
data.tar.gz: 7687567e96978e4a6903a8a6e6e335db842fb1926bb92739c0b2eecb1db19aa5e2c4c4983f285277986fb06d975f6143591e4c26bd24489da40dccbe89709b10
|
data/CHANGELOG.rdoc
CHANGED
@@ -99,7 +99,7 @@ module ActiveScaffold::Actions
|
|
99
99
|
copy_attributes(saved_record, record) if saved_record
|
100
100
|
apply_constraints_to_record(record) unless scope
|
101
101
|
create_association_with_parent record, true if nested?
|
102
|
-
update_record_from_params(record, columns, attributes || {}, true)
|
102
|
+
update_record_from_params(record, columns, attributes || {}, true, search_attributes: @form_action == :field_search)
|
103
103
|
end
|
104
104
|
|
105
105
|
def updated_record_with_column(column, value, scope)
|
@@ -60,7 +60,7 @@ module ActiveScaffold
|
|
60
60
|
#
|
61
61
|
# This is a secure way to apply params to a record, because it's based on a loop over the columns
|
62
62
|
# set. The columns set will not yield unauthorized columns, and it will not yield unregistered columns.
|
63
|
-
def update_record_from_params(parent_record, columns, attributes, avoid_changes = false)
|
63
|
+
def update_record_from_params(parent_record, columns, attributes, avoid_changes = false, search_attributes: false)
|
64
64
|
crud_type = parent_record.new_record? ? :create : :update
|
65
65
|
return parent_record unless parent_record.authorized_for?(:crud_type => crud_type)
|
66
66
|
|
@@ -74,6 +74,7 @@ module ActiveScaffold
|
|
74
74
|
if multi_parameter_attrs.key? column.name.to_s
|
75
75
|
parent_record.send(:assign_multiparameter_attributes, multi_parameter_attrs[column.name.to_s])
|
76
76
|
elsif attributes.key? column.name
|
77
|
+
next if search_attributes && params_hash?(attributes[column.name])
|
77
78
|
update_column_from_params(parent_record, column, attributes[column.name], avoid_changes)
|
78
79
|
end
|
79
80
|
rescue StandardError => e
|
@@ -37,6 +37,9 @@ module ActiveScaffold::Config
|
|
37
37
|
|
38
38
|
cattr_accessor :reset_form, instance_accessor: false
|
39
39
|
|
40
|
+
# whether refresh columns defined in update_columns when a column is changed, as create and update forms do
|
41
|
+
cattr_accessor :update_columns
|
42
|
+
|
40
43
|
# instance-level configuration
|
41
44
|
# ----------------------------
|
42
45
|
|
@@ -84,8 +87,11 @@ module ActiveScaffold::Config
|
|
84
87
|
|
85
88
|
attr_accessor :reset_form
|
86
89
|
|
90
|
+
# whether refresh columns defined in update_columns when a column is changed, as create and update forms do
|
91
|
+
attr_accessor :update_columns
|
92
|
+
|
87
93
|
UserSettings.class_eval do
|
88
|
-
user_attr :optional_columns, :group_options, :grouped_columns, :human_conditions, :floating_footer
|
94
|
+
user_attr :optional_columns, :group_options, :grouped_columns, :human_conditions, :floating_footer, :update_columns
|
89
95
|
end
|
90
96
|
end
|
91
97
|
end
|
@@ -6,8 +6,10 @@ module ActiveScaffold
|
|
6
6
|
# It does not do any rendering. It only decides which method is responsible for rendering.
|
7
7
|
def active_scaffold_search_for(column, options = nil)
|
8
8
|
options ||= active_scaffold_search_options(column)
|
9
|
-
|
10
|
-
|
9
|
+
if active_scaffold_config.field_search.update_columns
|
10
|
+
search_columns = active_scaffold_config.field_search.columns.visible_columns_names
|
11
|
+
options = update_columns_options(column, nil, options, form_columns: search_columns, url_params: {form_action: :field_search})
|
12
|
+
end
|
11
13
|
record = options[:object]
|
12
14
|
if column.delegated_association
|
13
15
|
record = record.send(column.delegated_association.name) || column.active_record_class.new
|
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: 3.7.
|
4
|
+
version: 3.7.12
|
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-02-
|
11
|
+
date: 2025-02-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|