active_scaffold 3.4.31 → 3.4.32

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,7 @@
1
1
  ---
2
- !binary "U0hBMQ==":
3
- metadata.gz: !binary |-
4
- Njc3MTJmNmJkOTRhZjNjYzQzZjc3ZTQ5NDM4ZjA3YzY4NTQ4ODE0Ng==
5
- data.tar.gz: !binary |-
6
- Y2IzMjdhNDI5ZDlmNjRjZTY2OWJhYTY2MjlkYmNiMDViNjUwMjU1Zg==
2
+ SHA1:
3
+ metadata.gz: 6004a079b687a908646771e73d99729c021c96ee
4
+ data.tar.gz: eac7053cc13b120de1dc2103238b30244c591cde
7
5
  SHA512:
8
- metadata.gz: !binary |-
9
- YzE2YWM2M2M2MzY1YWU1NGNiYzIxNDdmZTgwN2E2YmZjYzJlMGVkYmJjY2U3
10
- N2NjZjUyYjkyMzBmODZlNDFhYWE2MDE3ODBlNWY1NjZmYTI5YmFhOGQ5OWI0
11
- NWI3N2Q3ZTRkMmNhZjE1MzllYWZiMTEwMjk2ZTVkYmQ1ZWE0YmY=
12
- data.tar.gz: !binary |-
13
- Nzk2OWRhNTk5OWU4YjE3OTBlODc0OWJkODllZjAzYjliODVmM2QzNTQwYTEy
14
- NWE5MTk1Njc5MWRiYzhiNjMxOTg5OTFjZjljN2M0ZjIxM2U0NzhmZmVhMTM1
15
- ZmUxZGJmOWM0NTU3OTdlM2M3NzAwNGZmYTcyN2E2MDlkMzU0ZDA=
6
+ metadata.gz: 825c92099164fb09b36c7bc96a949658b189bd53a135767b17e12051f35eeb7ac5ab5683aa3f6f82394d98e29778d5fc6dfa3862263fff5418e18d76268f1b21
7
+ data.tar.gz: 5bced1d19c67d2c2b6d9d7eb0abe8c41445ff82acc5932a35e6b58ade664b401a94d4844a7e250a2bd0ce4233b35193647f216cf3895b7e1b19585113f85cc79
data/CHANGELOG CHANGED
@@ -1,3 +1,8 @@
1
+ - Add ActiveScaffold.reload_embedded JS method, to reload an embedded scaffold
2
+ - Fix nested on composite primary key associations
3
+ - Fix render :super on partials rendered with :collection (like _list_record)
4
+ - Fix required on paperclip, carrierwave and dragonfly bridges, when file is already saved
5
+
1
6
  = 3.4.31
2
7
  - fix multiple support for :select form_ui with non-association columns
3
8
  - remove yaml response support, not used in rails usually and no support for respond_to :yaml
@@ -451,6 +451,12 @@ var ActiveScaffold = {
451
451
  });
452
452
  });
453
453
  },
454
+ reload_embedded: function(element_or_selector) {
455
+ var item = jQuery(element_or_selector);
456
+ item.load(item.data('refresh'), function() {
457
+ jQuery(this).trigger('as:element_updated');
458
+ });
459
+ },
454
460
 
455
461
  records_for: function(tbody_id) {
456
462
  if (typeof(tbody_id) == 'string') tbody_id = '#' + tbody_id;
@@ -397,6 +397,10 @@ var ActiveScaffold = {
397
397
  new Ajax.Updater(item.up('.active-scaffold-component'), item.readAttribute('href'), {method: 'get', evalScripts: true});
398
398
  });
399
399
  },
400
+ reload_embedded: function(element) {
401
+ var item = $(element)
402
+ new Ajax.Updater(item, item.readAttribute('data-refresh'), {method: 'get', evalScripts: true});
403
+ },
400
404
 
401
405
  records_for: function(tbody_id) {
402
406
  var rows = [];
@@ -9,7 +9,7 @@ module ActiveScaffold
9
9
 
10
10
  carrierwave = record.send("#{column.name}")
11
11
  if !carrierwave.file.blank?
12
-
12
+ required = options.delete(:required)
13
13
  remove_field_options = {
14
14
  :name => options[:name].gsub(/\[#{column.name}\]$/, "[remove_#{column.name}]"),
15
15
  :id => 'remove_' + options[:id],
@@ -23,10 +23,10 @@ module ActiveScaffold
23
23
 
24
24
  case ActiveScaffold.js_framework
25
25
  when :jquery
26
- js_remove_file_code = "jQuery(this).prev('input#remove_#{options[:id]}').val('true'); jQuery(this).parent().hide().next().show(); return false;"
26
+ js_remove_file_code = "jQuery(this).prev('input#remove_#{options[:id]}').val('true'); jQuery(this).parent().hide().next().show()#{".find('input').attr('required', 'required')" if required}; return false;"
27
27
  js_dont_remove_file_code = "jQuery(this).parents('div.carrierwave_controls').find('input#remove_#{options[:id]}').val('false'); return false;"
28
28
  when :prototype
29
- js_remove_file_code = "$(this).previous('input#remove_#{options[:id]}').value='true'; $(this).up().hide().next().show(); return false;"
29
+ js_remove_file_code = "$(this).previous('input#remove_#{options[:id]}').value='true'; $(this).up().hide().next().show()#{".down().writeAttribute('required', 'required')" if required}; return false;"
30
30
  js_dont_remove_file_code = "$(this).up('div.carrierwave_controls').down('input#remove_#{options[:id]}').value='false'; return false;"
31
31
  end
32
32
 
@@ -6,15 +6,16 @@ module ActiveScaffold
6
6
  ActiveSupport::Deprecation.warn 'Relying on @record is deprecated, include :object in html_options with record.', caller if record.nil? # TODO: Remove when relying on @record is removed
7
7
  record ||= @record # TODO: Remove when relying on @record is removed
8
8
  options = active_scaffold_input_text_options(options.merge(column.options))
9
+ dragonfly = record.send("#{column.name}")
9
10
 
11
+ required = options.delete(:required) if dragonfly.present?
10
12
  input = file_field(:record, column.name, options)
11
- dragonfly = record.send("#{column.name}")
12
13
  if dragonfly.present?
13
14
  case ActiveScaffold.js_framework
14
15
  when :jquery
15
- js_remove_file_code = "jQuery(this).prev().val('true'); jQuery(this).parent().hide().next().show(); return false;"
16
+ js_remove_file_code = "jQuery(this).prev().val('true'); jQuery(this).parent().hide().next().show()#{".find('input').attr('required', 'required')" if required}; return false;"
16
17
  when :prototype
17
- js_remove_file_code = "$(this).previous().value='true'; $(this).up().hide().next().show(); return false;"
18
+ js_remove_file_code = "$(this).previous().value='true'; $(this).up().hide().next().show()#{".down().writeAttribute('required', 'required')" if required}; return false;"
18
19
  end
19
20
 
20
21
  content = active_scaffold_column_dragonfly(record, column)
@@ -6,15 +6,16 @@ module ActiveScaffold
6
6
  ActiveSupport::Deprecation.warn 'Relying on @record is deprecated, include :object in html_options with record.', caller if record.nil? # TODO: Remove when relying on @record is removed
7
7
  record ||= @record # TODO: Remove when relying on @record is removed
8
8
  options = active_scaffold_input_text_options(options.merge(column.options))
9
+ paperclip = record.send("#{column.name}")
9
10
 
11
+ required = options.delete(:required) if paperclip.file?
10
12
  input = file_field(:record, column.name, options)
11
- paperclip = record.send("#{column.name}")
12
13
  if paperclip.file?
13
14
  case ActiveScaffold.js_framework
14
15
  when :jquery
15
- js_remove_file_code = "jQuery(this).prev().val('true'); jQuery(this).parent().hide().next().show(); return false;"
16
+ js_remove_file_code = "jQuery(this).prev().val('true'); jQuery(this).parent().hide().next().show()#{".find('input').attr('required', 'required')" if required}; return false;"
16
17
  when :prototype
17
- js_remove_file_code = "$(this).previous().value='true'; $(this).up().hide().next().show(); return false;"
18
+ js_remove_file_code = "$(this).previous().value='true'; $(this).up().hide().next().show()#{".down().writeAttribute('required', 'required')" if required}; return false;"
18
19
  end
19
20
 
20
21
  object_name, method = options[:name].split(/\[(#{column.name})\]/)
@@ -134,7 +134,7 @@ module ActiveScaffold::DataStructures
134
134
 
135
135
  def iterate_model_associations(model)
136
136
  @constrained_fields = []
137
- constrained_fields << association.foreign_key.to_sym unless association.belongs_to?
137
+ constrained_fields << Array(association.foreign_key).map(&:to_sym) unless association.belongs_to?
138
138
  return if (reverse = association.reverse(model)).nil?
139
139
  @child_association = model.reflect_on_association(reverse)
140
140
  constrained_fields << @child_association.name unless @child_association == association
@@ -82,6 +82,7 @@ module ActionView::Helpers #:nodoc:
82
82
 
83
83
  elsif args.first == :super
84
84
  @_view_paths ||= lookup_context.view_paths.clone
85
+ @_last_template ||= lookup_context.last_template
85
86
  parts = @virtual_path.split('/')
86
87
  template = parts.pop
87
88
  prefix = parts.join('/')
@@ -103,6 +104,7 @@ module ActionView::Helpers #:nodoc:
103
104
  end
104
105
  result = render_without_active_scaffold options
105
106
  lookup_context.view_paths = @_view_paths if @_view_paths
107
+ lookup_context.last_template = @_last_template if @_last_template
106
108
  result
107
109
  else
108
110
  @_view_paths ||= lookup_context.view_paths.clone
@@ -2,7 +2,7 @@ module ActiveScaffold
2
2
  module Version
3
3
  MAJOR = 3
4
4
  MINOR = 4
5
- PATCH = 31
5
+ PATCH = 32
6
6
 
7
7
  STRING = [MAJOR, MINOR, PATCH].compact.join('.')
8
8
  end
metadata CHANGED
@@ -1,27 +1,27 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active_scaffold
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.4.31
4
+ version: 3.4.32
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-12-03 00:00:00.000000000 Z
11
+ date: 2015-12-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: brakeman
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ! '>='
17
+ - - '>='
18
18
  - !ruby/object:Gem::Version
19
19
  version: '0'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ! '>='
24
+ - - '>='
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0'
27
27
  - !ruby/object:Gem::Dependency
@@ -42,7 +42,7 @@ dependencies:
42
42
  name: rails
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - ! '>='
45
+ - - '>='
46
46
  - !ruby/object:Gem::Version
47
47
  version: 3.2.18
48
48
  - - <
@@ -52,7 +52,7 @@ dependencies:
52
52
  prerelease: false
53
53
  version_requirements: !ruby/object:Gem::Requirement
54
54
  requirements:
55
- - - ! '>='
55
+ - - '>='
56
56
  - !ruby/object:Gem::Version
57
57
  version: 3.2.18
58
58
  - - <
@@ -62,28 +62,28 @@ dependencies:
62
62
  name: rubocop
63
63
  requirement: !ruby/object:Gem::Requirement
64
64
  requirements:
65
- - - ! '>='
65
+ - - '>='
66
66
  - !ruby/object:Gem::Version
67
67
  version: '0'
68
68
  type: :development
69
69
  prerelease: false
70
70
  version_requirements: !ruby/object:Gem::Requirement
71
71
  requirements:
72
- - - ! '>='
72
+ - - '>='
73
73
  - !ruby/object:Gem::Version
74
74
  version: '0'
75
75
  - !ruby/object:Gem::Dependency
76
76
  name: shoulda
77
77
  requirement: !ruby/object:Gem::Requirement
78
78
  requirements:
79
- - - ! '>='
79
+ - - '>='
80
80
  - !ruby/object:Gem::Version
81
81
  version: '0'
82
82
  type: :development
83
83
  prerelease: false
84
84
  version_requirements: !ruby/object:Gem::Requirement
85
85
  requirements:
86
- - - ! '>='
86
+ - - '>='
87
87
  - !ruby/object:Gem::Version
88
88
  version: '0'
89
89
  description: Save time and headaches, and create a more easily maintainable set of
@@ -448,17 +448,17 @@ require_paths:
448
448
  - lib
449
449
  required_ruby_version: !ruby/object:Gem::Requirement
450
450
  requirements:
451
- - - ! '>='
451
+ - - '>='
452
452
  - !ruby/object:Gem::Version
453
453
  version: '1.9'
454
454
  required_rubygems_version: !ruby/object:Gem::Requirement
455
455
  requirements:
456
- - - ! '>='
456
+ - - '>='
457
457
  - !ruby/object:Gem::Version
458
458
  version: '0'
459
459
  requirements: []
460
460
  rubyforge_project:
461
- rubygems_version: 2.4.4
461
+ rubygems_version: 2.4.5
462
462
  signing_key:
463
463
  specification_version: 4
464
464
  summary: Rails 3.2, 4.0, 4.1 and 4.2 versions of ActiveScaffold supporting prototype