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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d5d2e7260966fbf6c4232d7a9750ccde96ba04bc234b770aedd47f934ac5274d
4
- data.tar.gz: 4b8d78f9e17a958ea0cf6486c5ea913a3afda356fe0fbefdcb1acce76e175e11
3
+ metadata.gz: 0ab6174a908369ed7071d91754c982eb08404643e4fb4df6e8f1a5671ba2671d
4
+ data.tar.gz: 4dc900e33aeebc279e50d0cf2db26a327c241b84fc4c3cace3a5da981151dba4
5
5
  SHA512:
6
- metadata.gz: 2b1634e907a0e0a2baae5dff8c6c4ca468f2684bf7c880a7d5413594c2cb06d12e2e5a9b8e53029b7492ca28d598f0db4e9c821c9bdcda818969e6ff5f13b892
7
- data.tar.gz: 622b7f77b49a1cae067296a11df2e9fb93adb7ba8efceeafa9530cbb3cc1b9ed1f84ac8210ea323203fefc521f1a0fb76c58c613cedba6a2c0ea91471844c389
6
+ metadata.gz: d4c3ae4876dfcd281c0d1b676c7af0eee264745fbbc3509f400eb54d46bdc2c08e707536eb6753dfe31387a877f5a8929975c20ab017bc7d9e503764f4c6f14c
7
+ data.tar.gz: 7687567e96978e4a6903a8a6e6e335db842fb1926bb92739c0b2eecb1db19aa5e2c4c4983f285277986fb06d975f6143591e4c26bd24489da40dccbe89709b10
data/CHANGELOG.rdoc CHANGED
@@ -1,3 +1,7 @@
1
+ = 3.7.12
2
+ - Fix using update_columns in field search with search UI submitting a hash, such as date fields
3
+ - Support disabling update_columsns on field_search
4
+
1
5
  = 3.7.11.1
2
6
  - Fix action link on association column named record
3
7
 
@@ -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
- search_columns = active_scaffold_config.field_search.columns.visible_columns_names
10
- options = update_columns_options(column, nil, options, form_columns: search_columns, url_params: {form_action: :field_search})
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
@@ -2,8 +2,8 @@ module ActiveScaffold
2
2
  module Version
3
3
  MAJOR = 3
4
4
  MINOR = 7
5
- PATCH = 11
6
- FIX = 1
5
+ PATCH = 12
6
+ FIX = nil
7
7
 
8
8
  STRING = [MAJOR, MINOR, PATCH, FIX].compact.join('.')
9
9
  end
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.11.1
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 00:00:00.000000000 Z
11
+ date: 2025-02-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails