active_scaffold 3.4.27 → 3.4.28
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 +5 -0
- data/app/views/active_scaffold_overrides/_list_record.html.erb +1 -1
- data/lib/active_scaffold/actions/core.rb +1 -1
- data/lib/active_scaffold/attribute_params.rb +1 -1
- data/lib/active_scaffold/core.rb +3 -1
- data/lib/active_scaffold/extensions/reverse_associations.rb +5 -1
- data/lib/active_scaffold/extensions/unsaved_associated.rb +4 -3
- data/lib/active_scaffold/helpers/form_column_helpers.rb +4 -2
- data/lib/active_scaffold/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: efbb6369eb3a5aa9cb4309e764850525ba2e46c2
|
|
4
|
+
data.tar.gz: 3acbbbe42eea4e99a3039eb36c9aeaab50bb9f1e
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 679592e18cba2f389ee6c7edaeab510c6ae761f51eedebb8f28846aaedb3e4265da572dae80b14aba23e74e34f63b07792efe6388335121b0c9bdcb612434f42
|
|
7
|
+
data.tar.gz: 2c30a66c8dcc58554cbfd011275f243fdc72304203d63b007ac9470ed0f3ce2f5a45e18614b52374f6f77a2759c3652e3041d6f9ed749899f344bf12ea08e8e3
|
data/CHANGELOG
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
- don't stop on first associated record with error
|
|
2
|
+
- compatibility fix for composite primary keys gem
|
|
3
|
+
- fix double columns output on json and xml formats
|
|
4
|
+
- fix for search_ui :multi_select on non-association column
|
|
5
|
+
|
|
1
6
|
= 3.4.27
|
|
2
7
|
- support use_html option in columns for inplace_edit
|
|
3
8
|
- don't add errors added on update_record_from_params to flash[:warning], they are on errors array, keep errors from update_record_from_params when running valid?
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
record = list_record if local_assigns[:list_record] # compat with render :partial :collection
|
|
3
3
|
columns ||= list_columns
|
|
4
4
|
row_id ||= element_row_id(:action => :list, :id => record.id)
|
|
5
|
-
tr_class = cycle("", "even-record")
|
|
5
|
+
tr_class = "#{cycle("", "even-record")} #{list_row_class(record)}"
|
|
6
6
|
action_links ||= active_scaffold_config.action_links.member
|
|
7
7
|
data_refresh ||= record.to_param
|
|
8
8
|
-%>
|
|
@@ -365,7 +365,7 @@ module ActiveScaffold::Actions
|
|
|
365
365
|
end
|
|
366
366
|
|
|
367
367
|
def virtual_columns(columns)
|
|
368
|
-
columns.reject { |col| active_scaffold_config.model.columns_hash[col] || active_scaffold_config.model.reflect_on_association(col) }
|
|
368
|
+
columns.reject { |col| active_scaffold_config.model.columns_hash[col.to_s] || active_scaffold_config.model.reflect_on_association(col) }
|
|
369
369
|
end
|
|
370
370
|
|
|
371
371
|
def association_columns(columns)
|
|
@@ -109,7 +109,7 @@ module ActiveScaffold
|
|
|
109
109
|
elsif attributes.key? column.name
|
|
110
110
|
value = update_column_from_params(parent_record, column, attributes[column.name], avoid_changes)
|
|
111
111
|
end
|
|
112
|
-
rescue
|
|
112
|
+
rescue => e
|
|
113
113
|
logger.error "#{e.class.name}: #{e.message} -- on the ActiveScaffold column = :#{column.name} for #{parent_record.inspect}#{" with value #{value}" if value}"
|
|
114
114
|
raise
|
|
115
115
|
end
|
data/lib/active_scaffold/core.rb
CHANGED
|
@@ -56,7 +56,9 @@ module ActiveScaffold
|
|
|
56
56
|
|
|
57
57
|
# sneak the action links from the actions into the main set
|
|
58
58
|
if link.is_a? Array
|
|
59
|
-
link.each
|
|
59
|
+
link.each do |current_link|
|
|
60
|
+
active_scaffold_config.action_links.add_to_group(current_link, active_scaffold_config.send(mod).action_group)
|
|
61
|
+
end
|
|
60
62
|
elsif link.is_a? ActiveScaffold::DataStructures::ActionLink
|
|
61
63
|
active_scaffold_config.action_links.add_to_group(link, active_scaffold_config.send(mod).action_group)
|
|
62
64
|
end
|
|
@@ -66,7 +66,11 @@ module ActiveScaffold
|
|
|
66
66
|
|
|
67
67
|
# otherwise, match them based on the foreign_key
|
|
68
68
|
when 0
|
|
69
|
-
|
|
69
|
+
if assoc.foreign_key.is_a? Array
|
|
70
|
+
next unless assoc.foreign_key.to_sym == foreign_key.to_sym
|
|
71
|
+
else
|
|
72
|
+
next unless assoc.foreign_key.to_sym == foreign_key.to_sym
|
|
73
|
+
end
|
|
70
74
|
end
|
|
71
75
|
|
|
72
76
|
reverse_matches << assoc
|
|
@@ -57,15 +57,16 @@ class ActiveRecord::Base
|
|
|
57
57
|
# returns false if any yield returns false.
|
|
58
58
|
# returns true otherwise, even when none of the associations have been instantiated. build wrapper methods accordingly.
|
|
59
59
|
def with_unsaved_associated
|
|
60
|
-
associations_for_update.
|
|
60
|
+
associations_for_update.map do |assoc|
|
|
61
61
|
association_proxy = association(assoc.name)
|
|
62
62
|
if association_proxy.target.present?
|
|
63
63
|
records = association_proxy.target
|
|
64
64
|
records = [records] unless records.is_a? Array # convert singular associations into collections for ease of use
|
|
65
|
-
|
|
65
|
+
# must use select instead of find_all, which Rails overrides on association proxies for db access
|
|
66
|
+
records.select { |r| r.unsaved? && !r.readonly? }.map { |r| yield r }.all?
|
|
66
67
|
else
|
|
67
68
|
true
|
|
68
69
|
end
|
|
69
|
-
end
|
|
70
|
+
end.all?
|
|
70
71
|
end
|
|
71
72
|
end
|
|
@@ -310,8 +310,10 @@ module ActiveScaffold
|
|
|
310
310
|
|
|
311
311
|
def active_scaffold_checkbox_option(option, label_method, associated_ids, checkbox_options, li_options = {})
|
|
312
312
|
content_tag(:li, li_options) do
|
|
313
|
-
|
|
314
|
-
|
|
313
|
+
option_id = option.is_a?(Array) ? option[1] : option.id
|
|
314
|
+
label = option.is_a?(Array) ? option[0] : option.send(label_method)
|
|
315
|
+
check_box_tag(checkbox_options[:name], option_id, associated_ids.include?(option_id), checkbox_options) <<
|
|
316
|
+
content_tag(:label, label, :for => checkbox_options[:id])
|
|
315
317
|
end
|
|
316
318
|
end
|
|
317
319
|
|
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.4.
|
|
4
|
+
version: 3.4.28
|
|
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: 2015-09-
|
|
11
|
+
date: 2015-09-22 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: brakeman
|