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 +4 -4
- data/CHANGELOG.rdoc +8 -1
- data/app/assets/javascripts/jquery/active_scaffold.js +2 -2
- 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/data_structures/action_links.rb +1 -1
- data/lib/active_scaffold/helpers/search_column_helpers.rb +4 -2
- data/lib/active_scaffold/version.rb +1 -1
- data/lib/active_scaffold.rb +5 -1
- 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
@@ -1,4 +1,11 @@
|
|
1
|
-
= 3.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
|
+
|
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
|
-
|
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
|
data/lib/active_scaffold.rb
CHANGED
@@ -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
|
-
|
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.
|
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:
|
11
|
+
date: 2025-02-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|