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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 48dc2381977713791be4113ae363aec520dbc8e0
4
- data.tar.gz: 98506d01af1b998e7692b1bf5c7ca1a720686a5a
3
+ metadata.gz: efbb6369eb3a5aa9cb4309e764850525ba2e46c2
4
+ data.tar.gz: 3acbbbe42eea4e99a3039eb36c9aeaab50bb9f1e
5
5
  SHA512:
6
- metadata.gz: 5f6740e7329844cbd546da3bc5738063bdb35ae794479cd5168d9cca99f0333f38644291a97d67d53104a517d55811f02771b410d2c0dc1991d7c7c2a86280c2
7
- data.tar.gz: 0f1ef0aa8d699221e6dec5b71a4ff0669dfde7adbc3cb7c9d0f7428fe027dbc321cbc9a394254fe6f15b15a6ae9f8c06bf2277cdf6cbb60c747cfb2cdce51d7f
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") + ' ' + list_row_class(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 StandardError => e
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
@@ -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 { |current| active_scaffold_config.action_links.add_to_group(current, active_scaffold_config.send(mod).action_group) }
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
- next unless assoc.foreign_key.to_sym == foreign_key.to_sym
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.all? do |assoc|
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
- records.select { |r| r.unsaved? && !r.readonly? }.all? { |r| yield r } # must use select instead of find_all, which Rails overrides on association proxies for db access
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
- check_box_tag(checkbox_options[:name], option.id, associated_ids.include?(option.id), checkbox_options) <<
314
- content_tag(:label, option.send(label_method), :for => checkbox_options[:id])
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
 
@@ -2,7 +2,7 @@ module ActiveScaffold
2
2
  module Version
3
3
  MAJOR = 3
4
4
  MINOR = 4
5
- PATCH = 27
5
+ PATCH = 28
6
6
 
7
7
  STRING = [MAJOR, MINOR, PATCH].compact.join('.')
8
8
  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.4.27
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-08 00:00:00.000000000 Z
11
+ date: 2015-09-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: brakeman