actionview 5.0.1 → 5.0.2.rc1

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of actionview might be problematic. Click here for more details.

checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d5a7c2ea185d0bea6fadc3a400e63324fd46c51d
4
- data.tar.gz: 65238e002ca68c09447e6e21ceb415b5dba45810
3
+ metadata.gz: 8a61387a3313f4b2f9dac927416bbc8d61106df5
4
+ data.tar.gz: bb85d75003939de6fd6a13c67d32bdd1f15fcb10
5
5
  SHA512:
6
- metadata.gz: 5753354ad5d7b3497c26a2d0a86a2921f0c94a9dd085bd2a699689b1e7009d69bc42c7659a3b2249b080d60cff6779038dd27f15f330870a2a1b967252f9019e
7
- data.tar.gz: bd55ffd5e58380cf678b1896b8ea1d73e32adeb9458ea8e062c62071cc433d872f585c8868b6568a28ba9481da36588896ae8b0be46a75eb1cab44c3447cbfb0
6
+ metadata.gz: e90fbda97dcea5cd0e42bf7adb73dfd61739cb989fe3769e380d29db775e1531957759a7456a25e32b116b681be14a6a6aa287978a27e8fcfea73a2cece5baef
7
+ data.tar.gz: 29ac80b6a84efea6a0487982345c6294a4250a20da23ec56b97919ce2732bb37aea75b358faf3e111d9351054c3d42a830bee396a00051eac54558a3a4b50633
@@ -1,3 +1,18 @@
1
+ ## Rails 5.0.2.rc1 (February 24, 2017) ##
2
+
3
+ * Allow render locals to be assigned to instance variables in a view.
4
+
5
+ Fixes #27480.
6
+
7
+ *Andrew White*
8
+
9
+ * Return correct object name in form helper method after `fields_for`.
10
+
11
+ Fixes #26931.
12
+
13
+ *Yuji Yaginuma*
14
+
15
+
1
16
  ## Rails 5.0.1 (December 21, 2016) ##
2
17
 
3
18
  * No changes.
@@ -7,8 +7,8 @@ module ActionView
7
7
  module VERSION
8
8
  MAJOR = 5
9
9
  MINOR = 0
10
- TINY = 1
11
- PRE = nil
10
+ TINY = 2
11
+ PRE = "rc1"
12
12
 
13
13
  STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".")
14
14
  end
@@ -1565,10 +1565,11 @@ module ActionView
1565
1565
  record_name = model_name_from_record_or_class(record_object).param_key
1566
1566
  end
1567
1567
 
1568
+ object_name = @object_name
1568
1569
  index = if options.has_key?(:index)
1569
1570
  options[:index]
1570
1571
  elsif defined?(@auto_index)
1571
- self.object_name = @object_name.to_s.sub(/\[\]$/,"")
1572
+ object_name = object_name.to_s.sub(/\[\]$/, "")
1572
1573
  @auto_index
1573
1574
  end
1574
1575
 
@@ -442,21 +442,9 @@ module ActionView
442
442
  # # => <input name='commit' type='submit' value='Save' data-disable-with="Save" data-confirm="Are you sure?" />
443
443
  #
444
444
  def submit_tag(value = "Save changes", options = {})
445
- options = options.stringify_keys
445
+ options = options.deep_stringify_keys
446
446
  tag_options = { "type" => "submit", "name" => "commit", "value" => value }.update(options)
447
-
448
- if ActionView::Base.automatically_disable_submit_tag
449
- unless tag_options["data-disable-with"] == false || (tag_options["data"] && tag_options["data"][:disable_with] == false)
450
- disable_with_text = tag_options["data-disable-with"]
451
- disable_with_text ||= tag_options["data"][:disable_with] if tag_options["data"]
452
- disable_with_text ||= value.to_s.clone
453
- tag_options.deep_merge!("data" => { "disable_with" => disable_with_text })
454
- else
455
- tag_options["data"].delete(:disable_with) if tag_options["data"]
456
- end
457
- tag_options.delete("data-disable-with")
458
- end
459
-
447
+ set_default_disable_with value, tag_options
460
448
  tag :input, tag_options
461
449
  end
462
450
 
@@ -897,6 +885,22 @@ module ActionView
897
885
  def sanitize_to_id(name)
898
886
  name.to_s.delete(']').tr('^-a-zA-Z0-9:.', "_")
899
887
  end
888
+
889
+ def set_default_disable_with(value, tag_options)
890
+ return unless ActionView::Base.automatically_disable_submit_tag
891
+ data = tag_options["data"]
892
+
893
+ unless tag_options["data-disable-with"] == false || (data && data["disable_with"] == false)
894
+ disable_with_text = tag_options["data-disable-with"]
895
+ disable_with_text ||= data["disable_with"] if data
896
+ disable_with_text ||= value.to_s.clone
897
+ tag_options.deep_merge!("data" => { "disable_with" => disable_with_text })
898
+ else
899
+ data.delete("disable_with") if data
900
+ end
901
+
902
+ tag_options.delete("data-disable-with")
903
+ end
900
904
  end
901
905
  end
902
906
  end
@@ -14,7 +14,14 @@ module ActionView
14
14
  @object_name.sub!(/\[\]$/,"") || @object_name.sub!(/\[\]\]$/,"]")
15
15
  @object = retrieve_object(options.delete(:object))
16
16
  @options = options
17
- @auto_index = Regexp.last_match ? retrieve_autoindex(Regexp.last_match.pre_match) : nil
17
+
18
+ if Regexp.last_match
19
+ @generate_indexed_names = true
20
+ @auto_index = retrieve_autoindex(Regexp.last_match.pre_match)
21
+ else
22
+ @generate_indexed_names = false
23
+ @auto_index = nil
24
+ end
18
25
  end
19
26
 
20
27
  # This is what child classes implement.
@@ -152,7 +159,11 @@ module ActionView
152
159
  end
153
160
 
154
161
  def name_and_id_index(options)
155
- options.key?("index") ? options.delete("index") || "" : @auto_index
162
+ if options.key?("index")
163
+ options.delete("index") || ""
164
+ elsif @generate_indexed_names
165
+ @auto_index || ""
166
+ end
156
167
  end
157
168
  end
158
169
  end
@@ -457,7 +457,7 @@ module ActionView
457
457
  locals[counter] = index
458
458
  locals[iteration] = partial_iteration
459
459
 
460
- template = (cache[path] ||= find_template(path, keys + [as, counter]))
460
+ template = (cache[path] ||= find_template(path, keys + [as, counter, iteration]))
461
461
  content = template.render(view, locals)
462
462
  partial_iteration.iterate!
463
463
  content
@@ -84,7 +84,8 @@ module ActionView
84
84
  end
85
85
 
86
86
  def rendered_format
87
- Template::Types[lookup_context.rendered_format]
87
+ format = lookup_context.rendered_format
88
+ Template::Types[format] || format
88
89
  end
89
90
 
90
91
  private
@@ -124,7 +125,11 @@ module ActionView
124
125
  key = action.include?(?/) ? :template : :action
125
126
  options[key] = action
126
127
  else
127
- options[:partial] = action
128
+ if action.respond_to?(:permitted?) && action.permitted?
129
+ options = action
130
+ else
131
+ options[:partial] = action
132
+ end
128
133
  end
129
134
 
130
135
  options
@@ -329,7 +329,7 @@ module ActionView
329
329
  # Only locals with valid variable names get set directly. Others will
330
330
  # still be available in local_assigns.
331
331
  locals = @locals - Module::RUBY_RESERVED_KEYWORDS
332
- locals = locals.grep(/\A(?![A-Z0-9])(?:[[:alnum:]_]|[^\0-\177])+\z/)
332
+ locals = locals.grep(/\A@?(?![A-Z0-9])(?:[[:alnum:]_]|[^\0-\177])+\z/)
333
333
 
334
334
  # Double assign to suppress the dreaded 'assigned but unused variable' warning
335
335
  locals.each_with_object("") { |key, code| code << "#{key} = #{key} = local_assigns[:#{key}];" }
@@ -147,8 +147,8 @@ module ActionView
147
147
  # This is what child classes implement. No defaults are needed
148
148
  # because Resolver guarantees that the arguments are present and
149
149
  # normalized.
150
- def find_templates(name, prefix, partial, details)
151
- raise NotImplementedError, "Subclasses must implement a find_templates(name, prefix, partial, details) method"
150
+ def find_templates(name, prefix, partial, details, outside_app_allowed = false)
151
+ raise NotImplementedError, "Subclasses must implement a find_templates(name, prefix, partial, details, outside_app_allowed = false) method"
152
152
  end
153
153
 
154
154
  # Helpers that builds a path. Useful for building virtual paths.
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: actionview
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.0.1
4
+ version: 5.0.2.rc1
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Heinemeier Hansson
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-12-21 00:00:00.000000000 Z
11
+ date: 2017-02-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: 5.0.1
19
+ version: 5.0.2.rc1
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - '='
25
25
  - !ruby/object:Gem::Version
26
- version: 5.0.1
26
+ version: 5.0.2.rc1
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: builder
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -61,7 +61,7 @@ dependencies:
61
61
  version: '1.0'
62
62
  - - ">="
63
63
  - !ruby/object:Gem::Version
64
- version: 1.0.2
64
+ version: 1.0.3
65
65
  type: :runtime
66
66
  prerelease: false
67
67
  version_requirements: !ruby/object:Gem::Requirement
@@ -71,7 +71,7 @@ dependencies:
71
71
  version: '1.0'
72
72
  - - ">="
73
73
  - !ruby/object:Gem::Version
74
- version: 1.0.2
74
+ version: 1.0.3
75
75
  - !ruby/object:Gem::Dependency
76
76
  name: rails-dom-testing
77
77
  requirement: !ruby/object:Gem::Requirement
@@ -92,28 +92,28 @@ dependencies:
92
92
  requirements:
93
93
  - - '='
94
94
  - !ruby/object:Gem::Version
95
- version: 5.0.1
95
+ version: 5.0.2.rc1
96
96
  type: :development
97
97
  prerelease: false
98
98
  version_requirements: !ruby/object:Gem::Requirement
99
99
  requirements:
100
100
  - - '='
101
101
  - !ruby/object:Gem::Version
102
- version: 5.0.1
102
+ version: 5.0.2.rc1
103
103
  - !ruby/object:Gem::Dependency
104
104
  name: activemodel
105
105
  requirement: !ruby/object:Gem::Requirement
106
106
  requirements:
107
107
  - - '='
108
108
  - !ruby/object:Gem::Version
109
- version: 5.0.1
109
+ version: 5.0.2.rc1
110
110
  type: :development
111
111
  prerelease: false
112
112
  version_requirements: !ruby/object:Gem::Requirement
113
113
  requirements:
114
114
  - - '='
115
115
  - !ruby/object:Gem::Version
116
- version: 5.0.1
116
+ version: 5.0.2.rc1
117
117
  description: Simple, battle-tested conventions and helpers for building web pages.
118
118
  email: david@loudthinking.com
119
119
  executables: []
@@ -238,15 +238,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
238
238
  version: 2.2.2
239
239
  required_rubygems_version: !ruby/object:Gem::Requirement
240
240
  requirements:
241
- - - ">="
241
+ - - ">"
242
242
  - !ruby/object:Gem::Version
243
- version: '0'
243
+ version: 1.3.1
244
244
  requirements:
245
245
  - none
246
246
  rubyforge_project:
247
- rubygems_version: 2.5.2
247
+ rubygems_version: 2.6.10
248
248
  signing_key:
249
249
  specification_version: 4
250
250
  summary: Rendering framework putting the V in MVC (part of Rails).
251
251
  test_files: []
252
- has_rdoc: