active_scaffold 3.4.28 → 3.4.29

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: efbb6369eb3a5aa9cb4309e764850525ba2e46c2
4
- data.tar.gz: 3acbbbe42eea4e99a3039eb36c9aeaab50bb9f1e
3
+ metadata.gz: dc80a3e80925ceb736fe6db2e5446e1ddf5e53bf
4
+ data.tar.gz: 38a31dc92324a6e82dec8b513693459ee8ca9724
5
5
  SHA512:
6
- metadata.gz: 679592e18cba2f389ee6c7edaeab510c6ae761f51eedebb8f28846aaedb3e4265da572dae80b14aba23e74e34f63b07792efe6388335121b0c9bdcb612434f42
7
- data.tar.gz: 2c30a66c8dcc58554cbfd011275f243fdc72304203d63b007ac9470ed0f3ce2f5a45e18614b52374f6f77a2759c3652e3041d6f9ed749899f344bf12ea08e8e3
6
+ metadata.gz: 32144972575f671e74215503ad1bd7fde30e80aa23724eb1c7a25d2e2c95860f969f3b775dd7838c785b34c871ad3a4c525365837d823fa932b84b87b57899d4
7
+ data.tar.gz: c2e27021d50cd84a14487cd500d8d262b0fd1b9f4aa5dd9be2962217205f086a78cedb75343010635eaed09d9540436a53ee7d90fa72e6e287df4a506f22d893
data/CHANGELOG CHANGED
@@ -1,3 +1,9 @@
1
+ = 3.4.29
2
+ - fix for search_ui :multi_select on non-association column and non integer options
3
+ - ensure id for radio button is valid
4
+ - check foregin_type present, not only nil, on polymorphic associations
5
+
6
+ = 3.4.28
1
7
  - don't stop on first associated record with error
2
8
  - compatibility fix for composite primary keys gem
3
9
  - fix double columns output on json and xml formats
@@ -717,15 +717,9 @@ var ActiveScaffold = {
717
717
  scroll_to: function(element, checkInViewport) {
718
718
  if (typeof checkInViewport == 'undefined') checkInViewport = true;
719
719
  if (typeof(element) == 'string') element = '#' + element;
720
- var form_offset = jQuery(element).offset().top;
721
- if (checkInViewport) {
722
- var docViewTop = jQuery(window).scrollTop(),
723
- docViewBottom = docViewTop + jQuery(window).height();
724
- // If it's in viewport , don't scroll;
725
- if (form_offset + jQuery(element).height() <= docViewBottom && form_offset >= docViewTop) return;
726
- }
727
-
728
- jQuery(document).scrollTop(form_offset);
720
+ element = jQuery(element);
721
+ if (checkInViewport && element.visible()) return;
722
+ jQuery(document).scrollTop(element.offset().top);
729
723
  },
730
724
 
731
725
  process_checkbox_inplace_edit: function(checkbox, options) {
@@ -176,7 +176,7 @@ module ActiveScaffold
176
176
  if value.present?
177
177
  if column.polymorphic_association?
178
178
  class_name = parent_record.send(column.association.foreign_type)
179
- class_name.constantize.find(value) if class_name
179
+ class_name.constantize.find(value) if class_name.present?
180
180
  else
181
181
  # it's a single id
182
182
  column.association.klass.find(value)
@@ -383,7 +383,7 @@ module ActiveScaffold
383
383
  text, value = active_scaffold_translated_option(column, text, value)
384
384
  end
385
385
 
386
- radio_options = html_options.merge(id_key => html_options[id_key] + '-' + value.to_s)
386
+ radio_options = html_options.merge(id_key => html_options[id_key] + '-' + value.to_s.parameterize)
387
387
  radio_options.merge!(checked) if checked
388
388
  html << content_tag(:label, radio_button(:record, column.name, value, radio_options) + text)
389
389
  end.html_safe
@@ -77,11 +77,13 @@ module ActiveScaffold
77
77
  record ||= @record # TODO: Remove when relying on @record is removed
78
78
  associated = options.delete :value
79
79
  associated = [associated].compact unless associated.is_a? Array
80
- associated.collect!(&:to_i)
81
80
 
82
81
  if column.association
82
+ associated.collect!(&:to_i)
83
83
  method = column.options[:label_method] || :to_label
84
- select_options = sorted_association_options_find(column.association, nil, record).collect { |r| [r.send(method), r.id] }
84
+ select_options = sorted_association_options_find(column.association, nil, record).collect do |r|
85
+ [r.send(method), r.id]
86
+ end
85
87
  else
86
88
  select_options = column.options[:options].collect do |text, value|
87
89
  active_scaffold_translated_option(column, text, value)
@@ -2,7 +2,7 @@ module ActiveScaffold
2
2
  module Version
3
3
  MAJOR = 3
4
4
  MINOR = 4
5
- PATCH = 28
5
+ PATCH = 29
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.28
4
+ version: 3.4.29
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-22 00:00:00.000000000 Z
11
+ date: 2015-10-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: brakeman