active_scaffold 3.7.11 → 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: 2199ef098b3b99353a45595e402dda98b4e98b2e7cca1f4c6db8c275a554559b
4
- data.tar.gz: c01c8d8f89f64973d37338ba60429ff3785d5eadbfb623dbd37e82f7d7bfe860
3
+ metadata.gz: 0ab6174a908369ed7071d91754c982eb08404643e4fb4df6e8f1a5671ba2671d
4
+ data.tar.gz: 4dc900e33aeebc279e50d0cf2db26a327c241b84fc4c3cace3a5da981151dba4
5
5
  SHA512:
6
- metadata.gz: 1126286c08d7ba994116d3a130f5bf682cfa0d1fbc603e727f34e0f5a9bda02ab5b7b4e9fd3483b53f3fa76b5b0b2c1c8077f700d5c2e5d079b8a9655edf9aa0
7
- data.tar.gz: 525eb6fe8a6a07f648303f6aec430ded090df9266b71856d0937583cde191e1fe57e480f386ab3d07f516f5a79f6cbafd43d2e6f1b54f79cc48f619f869a71dd
6
+ metadata.gz: d4c3ae4876dfcd281c0d1b676c7af0eee264745fbbc3509f400eb54d46bdc2c08e707536eb6753dfe31387a877f5a8929975c20ab017bc7d9e503764f4c6f14c
7
+ data.tar.gz: 7687567e96978e4a6903a8a6e6e335db842fb1926bb92739c0b2eecb1db19aa5e2c4c4983f285277986fb06d975f6143591e4c26bd24489da40dccbe89709b10
data/CHANGELOG.rdoc CHANGED
@@ -1,4 +1,11 @@
1
- = 3.7.11 (not released yet)
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
+
5
+ = 3.7.11.1
6
+ - Fix action link on association column named record
7
+
8
+ = 3.7.11
2
9
  - Add partial list_messages_content to reduce code duplication, and better support replacing list view with other way to render records
3
10
  - Support selector for records body in create_record_row JS method, better support replacing list view with other way to render records
4
11
  - Improve detection of member action links when list view is replaced with other structure, based on 'record' html class, instead of tags
@@ -1288,8 +1288,8 @@
1288
1288
  if (element.length > 0) {
1289
1289
  element.data(); // $ 1.4.2 workaround
1290
1290
  if (typeof(element.data('action_link')) === 'undefined' && !element.hasClass('as_adapter')) {
1291
- var parent = element.closest('.record');
1292
- if (parent.length === 0) parent = element.closest('.actions');
1291
+ var parent = element.parent().closest('.record');
1292
+ if (parent.length === 0) parent = element.parent().closest('.actions');
1293
1293
  if (parent.is('.record')) {
1294
1294
  // record action
1295
1295
  var target = parent.find('a.as_action');
@@ -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
@@ -177,9 +177,9 @@ module ActiveScaffold::DataStructures
177
177
  attr_accessor :css_class
178
178
 
179
179
  def name=(value)
180
- ActiveSupport::Deprecation.warn 'Changing name is deprecated, use css_class to change the class html attribute'
181
180
  self.css_class = value
182
181
  end
182
+ ActiveScaffold.deprecator.deprecate_methods(self, :name= => :css_class=)
183
183
 
184
184
  protected
185
185
 
@@ -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,7 +2,7 @@ module ActiveScaffold
2
2
  module Version
3
3
  MAJOR = 3
4
4
  MINOR = 7
5
- PATCH = 11
5
+ PATCH = 12
6
6
  FIX = nil
7
7
 
8
8
  STRING = [MAJOR, MINOR, PATCH, FIX].compact.join('.')
@@ -68,7 +68,7 @@ module ActiveScaffold
68
68
  end
69
69
  when :prototype then warning += ', convert your app to jQuery, and remove this call'
70
70
  end
71
- ActiveSupport::Deprecation.warn warning
71
+ deprecator.warn warning
72
72
  @@js_framework = framework
73
73
  end
74
74
 
@@ -110,6 +110,10 @@ module ActiveScaffold
110
110
  def self.defaults(&block)
111
111
  ActiveScaffold::Config::Core.configure(&block)
112
112
  end
113
+
114
+ def self.deprecator
115
+ @deprecator ||= ActiveSupport::Deprecation.new('4.0', 'ActiveScaffold')
116
+ end
113
117
  end
114
118
  require 'active_scaffold/engine'
115
119
  require 'ice_nine'
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
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: 2024-12-17 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