Skip to content
This repository
  • 9 commits
  • 29 files changed
  • 0 comments
  • 3 contributors
Aug 01, 2012
Santiago Pastorino This entry is wrong 74cf196
Aug 02, 2012
Mike Gunderloy Fix ActiveSupport integration with Mocha > 0.12.1
Mocha 0.12.2 renames the Integration module to
MonkeyPatching. This breaks the code Rails uses
to retrieve the assertion counter from Mocha.
5c42889
Rafael Mendonça França Do not consider the numeric attribute as changed if the old value is
zero and the new value is not a string.

Before this commit this was the behavior

r = Review.find_by_issue(0)
r.issue
=> 0
r.changes
=> {}
r.issue = 0
=> 0
r.changed?
=> true
r.changes
=> {"issue"=>[0,0]}

Fixes #7237
55e05d4
Rafael Mendonça França Use `:data => { :confirm => "Text" }` syntax instead of `:confirm` at
the ERB scaffold generator.

We are trying to teach the data attributes as best practices and
`:confirm` will be deprecated in 4.0.
9c1b1bd
Santiago Pastorino html_escape should escape single quotes
https://www.owasp.org/index.php/XSS_%28Cross_Site_Scripting%29_Prevention_Cheat_Sheet#RULE_.231_-_HTML_Escape_Before_Inserting_Untrusted_Data_into_HTML_Element_Content
Closes #7215

Conflicts:
	actionpack/test/template/erb_util_test.rb
	actionpack/test/template/form_tag_helper_test.rb
	actionpack/test/template/text_helper_test.rb
	actionpack/test/template/url_helper_test.rb
	activesupport/lib/active_support/core_ext/string/output_safety.rb
28f2c6f
Rafael Mendonça França Fix html_escape with Ruby 1.8 ebddf75
Rafael Mendonça França More `:rails_env` cleanup.
`Rails.env` already use development if ENV["RAILS_ENV"] is not present.
469d885
Aug 03, 2012
Santiago Pastorino Add CHANGELOG entry 5f9ae95
Santiago Pastorino Bump to 3.2.8.rc2 65b5e35

Showing 29 changed files with 89 additions and 64 deletions. Show diff stats Hide diff stats

  1. 2  RAILS_VERSION
  2. 2  actionmailer/lib/action_mailer/version.rb
  3. 2  actionpack/lib/action_pack/version.rb
  4. 2  actionpack/test/controller/new_base/render_template_test.rb
  5. 4  actionpack/test/controller/render_test.rb
  6. 16  actionpack/test/template/asset_tag_helper_test.rb
  7. 10  actionpack/test/template/erb_util_test.rb
  8. 6  actionpack/test/template/form_options_helper_test.rb
  9. 2  actionpack/test/template/form_tag_helper_test.rb
  10. 10  actionpack/test/template/javascript_helper_test.rb
  11. 2  actionpack/test/template/template_test.rb
  12. 10  actionpack/test/template/url_helper_test.rb
  13. 2  activemodel/lib/active_model/version.rb
  14. 8  activerecord/CHANGELOG.md
  15. 2  activerecord/lib/active_record/attribute_methods/dirty.rb
  16. 12  activerecord/lib/active_record/railties/databases.rake
  17. 2  activerecord/lib/active_record/version.rb
  18. 15  activerecord/test/cases/dirty_test.rb
  19. 2  activeresource/lib/active_resource/version.rb
  20. 2  activesupport/CHANGELOG.md
  21. 9  activesupport/lib/active_support/core_ext/string/output_safety.rb
  22. 4  activesupport/lib/active_support/testing/setup_and_teardown.rb
  23. 2  activesupport/lib/active_support/version.rb
  24. 4  activesupport/test/core_ext/string_ext_test.rb
  25. 11  railties/CHANGELOG.md
  26. 2  railties/lib/rails/generators/erb/scaffold/templates/index.html.erb
  27. 2  railties/lib/rails/version.rb
  28. 4  railties/test/application/assets_test.rb
  29. 2  version.rb
2  RAILS_VERSION
... ...
@@ -1 +1 @@
1  
-3.2.8.rc1
  1
+3.2.8.rc2
2  actionmailer/lib/action_mailer/version.rb
@@ -3,7 +3,7 @@ module VERSION #:nodoc:
3 3
     MAJOR = 3
4 4
     MINOR = 2
5 5
     TINY  = 8
6  
-    PRE   = "rc1"
  6
+    PRE   = "rc2"
7 7
 
8 8
     STRING = [MAJOR, MINOR, TINY, PRE].compact.join('.')
9 9
   end
2  actionpack/lib/action_pack/version.rb
@@ -3,7 +3,7 @@ module VERSION #:nodoc:
3 3
     MAJOR = 3
4 4
     MINOR = 2
5 5
     TINY  = 8
6  
-    PRE   = "rc1"
  6
+    PRE   = "rc2"
7 7
 
8 8
     STRING = [MAJOR, MINOR, TINY, PRE].compact.join('.')
9 9
   end
2  actionpack/test/controller/new_base/render_template_test.rb
@@ -126,7 +126,7 @@ class TestWithoutLayout < Rack::TestCase
126 126
     test "rendering a template with error properly excerts the code" do
127 127
       get :with_error
128 128
       assert_status 500
129  
-      assert_match "undefined local variable or method `idontexist'", response.body
  129
+      assert_match "undefined local variable or method `idontexist", response.body
130 130
     end
131 131
   end
132 132
 
4  actionpack/test/controller/render_test.rb
@@ -170,7 +170,7 @@ def render_text_hello_world
170 170
 
171 171
   # :ported:
172 172
   def render_text_hello_world_with_layout
173  
-    @variable_for_layout = ", I'm here!"
  173
+    @variable_for_layout = ", I am here!"
174 174
     render :text => "hello world", :layout => true
175 175
   end
176 176
 
@@ -831,7 +831,7 @@ def test_render_text
831 831
   # :ported:
832 832
   def test_do_with_render_text_and_layout
833 833
     get :render_text_hello_world_with_layout
834  
-    assert_equal "<html>hello world, I'm here!</html>", @response.body
  834
+    assert_equal "<html>hello world, I am here!</html>", @response.body
835 835
   end
836 836
 
837 837
   # :ported:
16  actionpack/test/template/asset_tag_helper_test.rb
@@ -162,8 +162,8 @@ def teardown
162 162
     %(image_tag(".pdf.png")) => %(<img alt=".pdf" src="/images/.pdf.png" />),
163 163
     %(image_tag("http://www.rubyonrails.com/images/rails.png")) => %(<img alt="Rails" src="http://www.rubyonrails.com/images/rails.png" />),
164 164
     %(image_tag("//www.rubyonrails.com/images/rails.png")) => %(<img alt="Rails" src="//www.rubyonrails.com/images/rails.png" />),
165  
-    %(image_tag("mouse.png", :mouseover => "/images/mouse_over.png")) => %(<img alt="Mouse" onmouseover="this.src='/images/mouse_over.png'" onmouseout="this.src='/images/mouse.png'" src="/images/mouse.png" />),
166  
-    %(image_tag("mouse.png", :mouseover => image_path("mouse_over.png"))) => %(<img alt="Mouse" onmouseover="this.src='/images/mouse_over.png'" onmouseout="this.src='/images/mouse.png'" src="/images/mouse.png" />),
  165
+    %(image_tag("mouse.png", :mouseover => "/images/mouse_over.png")) => %(<img alt="Mouse" onmouseover="this.src=&#x27;/images/mouse_over.png&#x27;" onmouseout="this.src=&#x27;/images/mouse.png&#x27;" src="/images/mouse.png" />),
  166
+    %(image_tag("mouse.png", :mouseover => image_path("mouse_over.png"))) => %(<img alt="Mouse" onmouseover="this.src=&#x27;/images/mouse_over.png&#x27;" onmouseout="this.src=&#x27;/images/mouse.png&#x27;" src="/images/mouse.png" />),
167 167
     %(image_tag("mouse.png", :alt => nil)) => %(<img src="/images/mouse.png" />),
168 168
     %(image_tag("data:image/gif;base64,R0lGODlhAQABAID/AMDAwAAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==", :alt => nil)) => %(<img src="data:image/gif;base64,R0lGODlhAQABAID/AMDAwAAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==" />),
169 169
     %(image_tag("")) => %(<img src="" />)
@@ -1105,8 +1105,8 @@ def test_should_compute_proper_path
1105 1105
     assert_dom_equal(%(/collaboration/hieraki/javascripts/xmlhr.js), javascript_path("xmlhr"))
1106 1106
     assert_dom_equal(%(/collaboration/hieraki/stylesheets/style.css), stylesheet_path("style"))
1107 1107
     assert_dom_equal(%(/collaboration/hieraki/images/xml.png), image_path("xml.png"))
1108  
-    assert_dom_equal(%(<img alt="Mouse" onmouseover="this.src='/collaboration/hieraki/images/mouse_over.png'" onmouseout="this.src='/collaboration/hieraki/images/mouse.png'" src="/collaboration/hieraki/images/mouse.png" />), image_tag("mouse.png", :mouseover => "/images/mouse_over.png"))
1109  
-    assert_dom_equal(%(<img alt="Mouse2" onmouseover="this.src='/collaboration/hieraki/images/mouse_over2.png'" onmouseout="this.src='/collaboration/hieraki/images/mouse2.png'" src="/collaboration/hieraki/images/mouse2.png" />), image_tag("mouse2.png", :mouseover => image_path("mouse_over2.png")))
  1108
+    assert_dom_equal(%(<img alt="Mouse" onmouseover="this.src=&#x27;/collaboration/hieraki/images/mouse_over.png&#x27;" onmouseout="this.src=&#x27;/collaboration/hieraki/images/mouse.png&#x27;" src="/collaboration/hieraki/images/mouse.png" />), image_tag("mouse.png", :mouseover => "/images/mouse_over.png"))
  1109
+    assert_dom_equal(%(<img alt="Mouse2" onmouseover="this.src=&#x27;/collaboration/hieraki/images/mouse_over2.png&#x27;" onmouseout="this.src=&#x27;/collaboration/hieraki/images/mouse2.png&#x27;" src="/collaboration/hieraki/images/mouse2.png" />), image_tag("mouse2.png", :mouseover => image_path("mouse_over2.png")))
1110 1110
   end
1111 1111
 
1112 1112
   def test_should_ignore_relative_root_path_on_complete_url
@@ -1119,8 +1119,8 @@ def test_should_compute_proper_path_with_asset_host
1119 1119
     assert_dom_equal(%(gopher://assets.example.com/collaboration/hieraki/javascripts/xmlhr.js), javascript_path("xmlhr"))
1120 1120
     assert_dom_equal(%(gopher://assets.example.com/collaboration/hieraki/stylesheets/style.css), stylesheet_path("style"))
1121 1121
     assert_dom_equal(%(gopher://assets.example.com/collaboration/hieraki/images/xml.png), image_path("xml.png"))
1122  
-    assert_dom_equal(%(<img alt="Mouse" onmouseover="this.src='gopher://assets.example.com/collaboration/hieraki/images/mouse_over.png'" onmouseout="this.src='gopher://assets.example.com/collaboration/hieraki/images/mouse.png'" src="gopher://assets.example.com/collaboration/hieraki/images/mouse.png" />), image_tag("mouse.png", :mouseover => "/images/mouse_over.png"))
1123  
-    assert_dom_equal(%(<img alt="Mouse2" onmouseover="this.src='gopher://assets.example.com/collaboration/hieraki/images/mouse_over2.png'" onmouseout="this.src='gopher://assets.example.com/collaboration/hieraki/images/mouse2.png'" src="gopher://assets.example.com/collaboration/hieraki/images/mouse2.png" />), image_tag("mouse2.png", :mouseover => image_path("mouse_over2.png")))
  1122
+    assert_dom_equal(%(<img alt="Mouse" onmouseover="this.src=&#x27;gopher://assets.example.com/collaboration/hieraki/images/mouse_over.png&#x27;" onmouseout="this.src=&#x27;gopher://assets.example.com/collaboration/hieraki/images/mouse.png&#x27;" src="gopher://assets.example.com/collaboration/hieraki/images/mouse.png" />), image_tag("mouse.png", :mouseover => "/images/mouse_over.png"))
  1123
+    assert_dom_equal(%(<img alt="Mouse2" onmouseover="this.src=&#x27;gopher://assets.example.com/collaboration/hieraki/images/mouse_over2.png&#x27;" onmouseout="this.src=&#x27;gopher://assets.example.com/collaboration/hieraki/images/mouse2.png&#x27;" src="gopher://assets.example.com/collaboration/hieraki/images/mouse2.png" />), image_tag("mouse2.png", :mouseover => image_path("mouse_over2.png")))
1124 1124
   end
1125 1125
 
1126 1126
   def test_should_compute_proper_path_with_asset_host_and_default_protocol
@@ -1129,8 +1129,8 @@ def test_should_compute_proper_path_with_asset_host_and_default_protocol
1129 1129
     assert_dom_equal(%(gopher://assets.example.com/collaboration/hieraki/javascripts/xmlhr.js), javascript_path("xmlhr"))
1130 1130
     assert_dom_equal(%(gopher://assets.example.com/collaboration/hieraki/stylesheets/style.css), stylesheet_path("style"))
1131 1131
     assert_dom_equal(%(gopher://assets.example.com/collaboration/hieraki/images/xml.png), image_path("xml.png"))
1132  
-    assert_dom_equal(%(<img alt="Mouse" onmouseover="this.src='gopher://assets.example.com/collaboration/hieraki/images/mouse_over.png'" onmouseout="this.src='gopher://assets.example.com/collaboration/hieraki/images/mouse.png'" src="gopher://assets.example.com/collaboration/hieraki/images/mouse.png" />), image_tag("mouse.png", :mouseover => "/images/mouse_over.png"))
1133  
-    assert_dom_equal(%(<img alt="Mouse2" onmouseover="this.src='gopher://assets.example.com/collaboration/hieraki/images/mouse_over2.png'" onmouseout="this.src='gopher://assets.example.com/collaboration/hieraki/images/mouse2.png'" src="gopher://assets.example.com/collaboration/hieraki/images/mouse2.png" />), image_tag("mouse2.png", :mouseover => image_path("mouse_over2.png")))
  1132
+    assert_dom_equal(%(<img alt="Mouse" onmouseover="this.src=&#x27;gopher://assets.example.com/collaboration/hieraki/images/mouse_over.png&#x27;" onmouseout="this.src=&#x27;gopher://assets.example.com/collaboration/hieraki/images/mouse.png&#x27;" src="gopher://assets.example.com/collaboration/hieraki/images/mouse.png" />), image_tag("mouse.png", :mouseover => "/images/mouse_over.png"))
  1133
+    assert_dom_equal(%(<img alt="Mouse2" onmouseover="this.src=&#x27;gopher://assets.example.com/collaboration/hieraki/images/mouse_over2.png&#x27;" onmouseout="this.src=&#x27;gopher://assets.example.com/collaboration/hieraki/images/mouse2.png&#x27;" src="gopher://assets.example.com/collaboration/hieraki/images/mouse2.png" />), image_tag("mouse2.png", :mouseover => image_path("mouse_over2.png")))
1134 1134
   end
1135 1135
 
1136 1136
   def test_should_ignore_asset_host_on_complete_url
10  actionpack/test/template/erb_util_test.rb
@@ -8,11 +8,11 @@ class ErbUtilTest < Test::Unit::TestCase
8 8
     define_method "test_html_escape_#{expected.gsub(/\W/, '')}" do
9 9
       assert_equal expected, html_escape(given)
10 10
     end
  11
+  end
11 12
 
12  
-    unless given == '"'
13  
-      define_method "test_json_escape_#{expected.gsub(/\W/, '')}" do
14  
-        assert_equal ERB::Util::JSON_ESCAPE[given], json_escape(given)
15  
-      end
  13
+  ERB::Util::JSON_ESCAPE.each do |given, expected|
  14
+    define_method "test_json_escape_#{expected.gsub(/\W/, '')}" do
  15
+      assert_equal ERB::Util::JSON_ESCAPE[given], json_escape(given)
16 16
     end
17 17
   end
18 18
 
@@ -40,7 +40,7 @@ def test_html_escape_passes_html_escpe_unmodified
40 40
 
41 41
   def test_rest_in_ascii
42 42
     (0..127).to_a.map {|int| int.chr }.each do |chr|
43  
-      next if chr.in?('&"<>')
  43
+      next if chr.in?('&"<>\'')
44 44
       assert_equal chr, html_escape(chr)
45 45
     end
46 46
   end
6  actionpack/test/template/form_options_helper_test.rb
@@ -1011,7 +1011,7 @@ def test_time_zone_select_with_default_time_zone_and_value
1011 1011
 
1012 1012
   def test_options_for_select_with_element_attributes
1013 1013
     assert_dom_equal(
1014  
-      "<option value=\"&lt;Denmark&gt;\" class=\"bold\">&lt;Denmark&gt;</option>\n<option value=\"USA\" onclick=\"alert('Hello World');\">USA</option>\n<option value=\"Sweden\">Sweden</option>\n<option value=\"Germany\">Germany</option>",
  1014
+      "<option value=\"&lt;Denmark&gt;\" class=\"bold\">&lt;Denmark&gt;</option>\n<option value=\"USA\" onclick=\"alert(&#x27;Hello World&#x27;);\">USA</option>\n<option value=\"Sweden\">Sweden</option>\n<option value=\"Germany\">Germany</option>",
1015 1015
       options_for_select([ [ "<Denmark>", { :class => 'bold' } ], [ "USA", { :onclick => "alert('Hello World');" } ], [ "Sweden" ], "Germany" ])
1016 1016
     )
1017 1017
   end
@@ -1047,13 +1047,13 @@ def test_option_html_attributes_with_single_element_hash
1047 1047
   def test_option_html_attributes_with_multiple_element_hash
1048 1048
     output = option_html_attributes([ 'foo', 'bar', { :class => 'fancy', 'onclick' => "alert('Hello World');" } ])
1049 1049
     assert output.include?(" class=\"fancy\"")
1050  
-    assert output.include?(" onclick=\"alert('Hello World');\"")
  1050
+    assert output.include?(" onclick=\"alert(&#x27;Hello World&#x27;);\"")
1051 1051
   end
1052 1052
 
1053 1053
   def test_option_html_attributes_with_multiple_hashes
1054 1054
     output = option_html_attributes([ 'foo', 'bar', { :class => 'fancy' }, { 'onclick' => "alert('Hello World');" } ])
1055 1055
     assert output.include?(" class=\"fancy\"")
1056  
-    assert output.include?(" onclick=\"alert('Hello World');\"")
  1056
+    assert output.include?(" onclick=\"alert(&#x27;Hello World&#x27;);\"")
1057 1057
   end
1058 1058
 
1059 1059
   def test_option_html_attributes_with_special_characters
2  actionpack/test/template/form_tag_helper_test.rb
@@ -368,7 +368,7 @@ def test_stringify_symbol_keys
368 368
 
369 369
   def test_submit_tag
370 370
     assert_dom_equal(
371  
-      %(<input name='commit' data-disable-with="Saving..." onclick="alert('hello!')" type="submit" value="Save" />),
  371
+      %(<input name='commit' data-disable-with="Saving..." onclick="alert(&#x27;hello!&#x27;)" type="submit" value="Save" />),
372 372
       submit_tag("Save", :disable_with => "Saving...", :onclick => "alert('hello!')")
373 373
     )
374 374
   end
10  actionpack/test/template/javascript_helper_test.rb
@@ -46,12 +46,12 @@ def test_escape_javascript_with_safebuffer
46 46
   end
47 47
 
48 48
   def test_button_to_function
49  
-    assert_dom_equal %(<input type="button" onclick="alert('Hello world!');" value="Greeting" />),
  49
+    assert_dom_equal %(<input type="button" onclick="alert(&#x27;Hello world!&#x27;);" value="Greeting" />),
50 50
       button_to_function("Greeting", "alert('Hello world!')")
51 51
   end
52 52
 
53 53
   def test_button_to_function_with_onclick
54  
-    assert_dom_equal "<input onclick=\"alert('Goodbye World :('); alert('Hello world!');\" type=\"button\" value=\"Greeting\" />",
  54
+    assert_dom_equal "<input onclick=\"alert(&#x27;Goodbye World :(&#x27;); alert(&#x27;Hello world!&#x27;);\" type=\"button\" value=\"Greeting\" />",
55 55
       button_to_function("Greeting", "alert('Hello world!')", :onclick => "alert('Goodbye World :(')")
56 56
   end
57 57
 
@@ -61,17 +61,17 @@ def test_button_to_function_without_function
61 61
   end
62 62
 
63 63
   def test_link_to_function
64  
-    assert_dom_equal %(<a href="#" onclick="alert('Hello world!'); return false;">Greeting</a>),
  64
+    assert_dom_equal %(<a href="#" onclick="alert(&#x27;Hello world!&#x27;); return false;">Greeting</a>),
65 65
       link_to_function("Greeting", "alert('Hello world!')")
66 66
   end
67 67
 
68 68
   def test_link_to_function_with_existing_onclick
69  
-    assert_dom_equal %(<a href="#" onclick="confirm('Sanity!'); alert('Hello world!'); return false;">Greeting</a>),
  69
+    assert_dom_equal %(<a href="#" onclick="confirm(&#x27;Sanity!&#x27;); alert(&#x27;Hello world!&#x27;); return false;">Greeting</a>),
70 70
       link_to_function("Greeting", "alert('Hello world!')", :onclick => "confirm('Sanity!')")
71 71
   end
72 72
 
73 73
   def test_function_with_href
74  
-    assert_dom_equal %(<a href="http://example.com/" onclick="alert('Hello world!'); return false;">Greeting</a>),
  74
+    assert_dom_equal %(<a href="http://example.com/" onclick="alert(&#x27;Hello world!&#x27;); return false;">Greeting</a>),
75 75
       link_to_function("Greeting", "alert('Hello world!')", :href => 'http://example.com/')
76 76
   end
77 77
 
2  actionpack/test/template/template_test.rb
@@ -79,7 +79,7 @@ def test_template_does_not_lose_its_source_after_rendering_if_it_does_not_have_a
79 79
   def test_locals
80 80
     @template = new_template("<%= my_local %>")
81 81
     @template.locals = [:my_local]
82  
-    assert_equal "I'm a local", render(:my_local => "I'm a local")
  82
+    assert_equal "I am a local", render(:my_local => "I am a local")
83 83
   end
84 84
 
85 85
   def test_restores_buffer
10  actionpack/test/template/url_helper_test.rb
@@ -194,7 +194,7 @@ def test_link_with_nil_html_options
194 194
 
195 195
   def test_link_tag_with_custom_onclick
196 196
     link = link_to("Hello", "http://www.example.com", :onclick => "alert('yay!')")
197  
-    expected = %{<a href="http://www.example.com" onclick="alert('yay!')">Hello</a>}
  197
+    expected = %{<a href="http://www.example.com" onclick="alert(&#x27;yay!&#x27;)">Hello</a>}
198 198
     assert_dom_equal expected, link
199 199
   end
200 200
 
@@ -204,12 +204,12 @@ def test_link_tag_with_javascript_confirm
204 204
       link_to("Hello", "http://www.example.com", :confirm => "Are you sure?")
205 205
     )
206 206
     assert_dom_equal(
207  
-      "<a href=\"http://www.example.com\" data-confirm=\"You can't possibly be sure, can you?\">Hello</a>",
208  
-      link_to("Hello", "http://www.example.com", :confirm => "You can't possibly be sure, can you?")
  207
+      "<a href=\"http://www.example.com\" data-confirm=\"You cant possibly be sure, can you?\">Hello</a>",
  208
+      link_to("Hello", "http://www.example.com", :confirm => "You cant possibly be sure, can you?")
209 209
     )
210 210
     assert_dom_equal(
211  
-      "<a href=\"http://www.example.com\" data-confirm=\"You can't possibly be sure,\n can you?\">Hello</a>",
212  
-      link_to("Hello", "http://www.example.com", :confirm => "You can't possibly be sure,\n can you?")
  211
+      "<a href=\"http://www.example.com\" data-confirm=\"You cant possibly be sure,\n can you?\">Hello</a>",
  212
+      link_to("Hello", "http://www.example.com", :confirm => "You cant possibly be sure,\n can you?")
213 213
     )
214 214
   end
215 215
 
2  activemodel/lib/active_model/version.rb
@@ -3,7 +3,7 @@ module VERSION #:nodoc:
3 3
     MAJOR = 3
4 4
     MINOR = 2
5 5
     TINY  = 8
6  
-    PRE   = "rc1"
  6
+    PRE   = "rc2"
7 7
 
8 8
     STRING = [MAJOR, MINOR, TINY, PRE].compact.join('.')
9 9
   end
8  activerecord/CHANGELOG.md
Source Rendered
... ...
@@ -1,5 +1,11 @@
1 1
 ## Rails 3.2.8 ##
2 2
 
  3
+*   Do not consider the numeric attribute as changed if the old value is zero and the new value
  4
+    is not a string.
  5
+    Fixes #7237.
  6
+
  7
+    *Rafael Mendonça França*
  8
+
3 9
 *   Removes the deprecation of `update_attribute`. *fxn*
4 10
 
5 11
 *   Reverted the deprecation of `composed_of`. *Rafael Mendonça França*
@@ -20,8 +26,6 @@
20 26
 
21 27
     *Rafael Mendonça França*
22 28
 
23  
-*   update_columns added. *Sebastián Martínez*
24  
-
25 29
 ## Rails 3.2.7 (Jul 26, 2012) ##
26 30
 
27 31
 *   `:finder_sql` and `:counter_sql` options on collection associations
2  activerecord/lib/active_record/attribute_methods/dirty.rb
@@ -104,7 +104,7 @@ def changes_from_nil_to_empty_string?(column, old, value)
104 104
 
105 105
       def changes_from_zero_to_string?(old, value)
106 106
         # For columns with old 0 and value non-empty string
107  
-        old == 0 && value.present? && value != '0'
  107
+        old == 0 && value.is_a?(String) && value.present? && value != '0'
108 108
       end
109 109
     end
110 110
   end
12  activerecord/lib/active_record/railties/databases.rake
@@ -200,7 +200,7 @@ db_namespace = namespace :db do
200 200
     end
201 201
 
202 202
     desc 'Display status of migrations'
203  
-    task :status => [:environment, :load_config, :rails_env] do
  203
+    task :status => [:environment, :load_config] do
204 204
       config = ActiveRecord::Base.configurations[Rails.env]
205 205
       ActiveRecord::Base.establish_connection(config)
206 206
       unless ActiveRecord::Base.connection.table_exists?(ActiveRecord::Migrator.schema_migrations_table_name)
@@ -253,7 +253,7 @@ db_namespace = namespace :db do
253 253
   end
254 254
 
255 255
   # desc "Retrieves the charset for the current environment's database"
256  
-  task :charset => [:environment, :load_config, :rails_env] do
  256
+  task :charset => [:environment, :load_config] do
257 257
     config = ActiveRecord::Base.configurations[Rails.env]
258 258
     case config['adapter']
259 259
     when /mysql/
@@ -271,7 +271,7 @@ db_namespace = namespace :db do
271 271
   end
272 272
 
273 273
   # desc "Retrieves the collation for the current environment's database"
274  
-  task :collation => [:environment, :load_config, :rails_env] do
  274
+  task :collation => [:environment, :load_config] do
275 275
     config = ActiveRecord::Base.configurations[Rails.env]
276 276
     case config['adapter']
277 277
     when /mysql/
@@ -311,7 +311,7 @@ db_namespace = namespace :db do
311 311
 
312 312
   namespace :fixtures do
313 313
     desc "Load fixtures into the current environment's database. Load specific fixtures using FIXTURES=x,y. Load from subdirectory in test/fixtures using FIXTURES_DIR=z. Specify an alternative path (eg. spec/fixtures) using FIXTURES_PATH=spec/fixtures."
314  
-    task :load => [:environment, :load_config, :rails_env] do
  314
+    task :load => [:environment, :load_config] do
315 315
       require 'active_record/fixtures'
316 316
 
317 317
       ActiveRecord::Base.establish_connection(Rails.env)
@@ -349,7 +349,7 @@ db_namespace = namespace :db do
349 349
 
350 350
   namespace :schema do
351 351
     desc 'Create a db/schema.rb file that can be portably used against any DB supported by AR'
352  
-    task :dump => [:environment, :load_config, :rails_env] do
  352
+    task :dump => [:environment, :load_config] do
353 353
       require 'active_record/schema_dumper'
354 354
       filename = ENV['SCHEMA'] || "#{Rails.root}/db/schema.rb"
355 355
       File.open(filename, "w:utf-8") do |file|
@@ -376,7 +376,7 @@ db_namespace = namespace :db do
376 376
 
377 377
   namespace :structure do
378 378
     desc 'Dump the database structure to db/structure.sql. Specify another file with DB_STRUCTURE=db/my_structure.sql'
379  
-    task :dump => [:environment, :load_config, :rails_env] do
  379
+    task :dump => [:environment, :load_config] do
380 380
       abcs = ActiveRecord::Base.configurations
381 381
       filename = ENV['DB_STRUCTURE'] || File.join(Rails.root, "db", "structure.sql")
382 382
       case abcs[Rails.env]['adapter']
2  activerecord/lib/active_record/version.rb
@@ -3,7 +3,7 @@ module VERSION #:nodoc:
3 3
     MAJOR = 3
4 4
     MINOR = 2
5 5
     TINY  = 8
6  
-    PRE   = "rc1"
  6
+    PRE   = "rc2"
7 7
 
8 8
     STRING = [MAJOR, MINOR, TINY, PRE].compact.join('.')
9 9
   end
15  activerecord/test/cases/dirty_test.rb
@@ -201,7 +201,7 @@ def test_nullable_float_not_marked_as_changed_if_new_value_is_blank
201 201
     end
202 202
   end
203 203
 
204  
-  def test_nullable_integer_zero_to_string_zero_not_marked_as_changed
  204
+  def test_integer_zero_to_string_zero_not_marked_as_changed
205 205
     pirate = Pirate.new
206 206
     pirate.parrot_id = 0
207 207
     pirate.catchphrase = 'arrr'
@@ -213,6 +213,19 @@ def test_nullable_integer_zero_to_string_zero_not_marked_as_changed
213 213
     assert !pirate.changed?
214 214
   end
215 215
 
  216
+  def test_integer_zero_to_integer_zero_not_marked_as_changed
  217
+    pirate = Pirate.new
  218
+    pirate.parrot_id = 0
  219
+    pirate.catchphrase = 'arrr'
  220
+    assert pirate.save!
  221
+
  222
+    assert !pirate.changed?
  223
+
  224
+    pirate.parrot_id = 0
  225
+    assert !pirate.changed?
  226
+  end
  227
+
  228
+
216 229
   def test_zero_to_blank_marked_as_changed
217 230
     pirate = Pirate.new
218 231
     pirate.catchphrase = "Yarrrr, me hearties"
2  activeresource/lib/active_resource/version.rb
@@ -3,7 +3,7 @@ module VERSION #:nodoc:
3 3
     MAJOR = 3
4 4
     MINOR = 2
5 5
     TINY  = 8
6  
-    PRE   = "rc1"
  6
+    PRE   = "rc2"
7 7
 
8 8
     STRING = [MAJOR, MINOR, TINY, PRE].compact.join('.')
9 9
   end
2  activesupport/CHANGELOG.md
Source Rendered
... ...
@@ -1,5 +1,7 @@
1 1
 ## Rails 3.2.8 ##
2 2
 
  3
+*   Fix ActiveSupport integration with Mocha > 0.12.1. *Mike Gunderloy*
  4
+
3 5
 *   Reverted the deprecation of ActiveSupport::JSON::Variable. *Rafael Mendonça França*
4 6
 
5 7
 ## Rails 3.2.7 (Jul 26, 2012) ##
9  activesupport/lib/active_support/core_ext/string/output_safety.rb
@@ -3,11 +3,10 @@
3 3
 
4 4
 class ERB
5 5
   module Util
6  
-    HTML_ESCAPE = { '&' => '&amp;',  '>' => '&gt;',   '<' => '&lt;', '"' => '&quot;' }
  6
+    HTML_ESCAPE = { '&' => '&amp;',  '>' => '&gt;',   '<' => '&lt;', '"' => '&quot;', "'" => '&#x27;' }
7 7
     JSON_ESCAPE = { '&' => '\u0026', '>' => '\u003E', '<' => '\u003C' }
8 8
 
9  
-    # Detect whether 1.9 can transcode with XML escaping.
10  
-    if '"&gt;&lt;&amp;&quot;"' == ('><&"'.encode('utf-8', :xml => :attr) rescue false)
  9
+    if RUBY_VERSION >= '1.9'
11 10
       # A utility method for escaping HTML tag characters.
12 11
       # This method is also aliased as <tt>h</tt>.
13 12
       #
@@ -22,7 +21,7 @@ def html_escape(s)
22 21
         if s.html_safe?
23 22
           s
24 23
         else
25  
-          s.encode(s.encoding, :xml => :attr)[1...-1].html_safe
  24
+          s.gsub(/[&"'><]/, HTML_ESCAPE).html_safe
26 25
         end
27 26
       end
28 27
     else
@@ -31,7 +30,7 @@ def html_escape(s) #:nodoc:
31 30
         if s.html_safe?
32 31
           s
33 32
         else
34  
-          s.gsub(/[&"><]/n) { |special| HTML_ESCAPE[special] }.html_safe
  33
+          s.gsub(/[&"'><]/n) { |special| HTML_ESCAPE[special] }.html_safe
35 34
         end
36 35
       end
37 36
     end
4  activesupport/lib/active_support/testing/setup_and_teardown.rb
@@ -104,8 +104,10 @@ def retrieve_mocha_counter(result) #:nodoc:
104 104
           if respond_to?(:mocha_verify) # using mocha
105 105
             if defined?(Mocha::TestCaseAdapter::AssertionCounter)
106 106
               Mocha::TestCaseAdapter::AssertionCounter.new(result)
107  
-            else
  107
+            elsif defined?(Mocha::Integration::TestUnit::AssertionCounter)
108 108
               Mocha::Integration::TestUnit::AssertionCounter.new(result)
  109
+            else
  110
+              Mocha::MonkeyPatching::TestUnit::AssertionCounter.new(result)
109 111
             end
110 112
           end
111 113
         end
2  activesupport/lib/active_support/version.rb
@@ -3,7 +3,7 @@ module VERSION #:nodoc:
3 3
     MAJOR = 3
4 4
     MINOR = 2
5 5
     TINY  = 8
6  
-    PRE   = "rc1"
  6
+    PRE   = "rc2"
7 7
 
8 8
     STRING = [MAJOR, MINOR, TINY, PRE].compact.join('.')
9 9
   end
4  activesupport/test/core_ext/string_ext_test.rb
@@ -493,8 +493,8 @@ def to_s
493 493
   end
494 494
 
495 495
   test "ERB::Util.html_escape should escape unsafe characters" do
496  
-    string = '<>&"'
497  
-    expected = '&lt;&gt;&amp;&quot;'
  496
+    string = '<>&"\''
  497
+    expected = '&lt;&gt;&amp;&quot;&#x27;'
498 498
     assert_equal expected, ERB::Util.html_escape(string)
499 499
   end
500 500
 
11  railties/CHANGELOG.md
Source Rendered
... ...
@@ -1,16 +1,21 @@
1 1
 ## Rails 3.2.8 ##
2 2
 
3  
-*   No changes.
  3
+*   ERB scaffold generator use the `:data => { :confirm => "Text" }` syntax instead of `:confirm`.
  4
+
  5
+    *Rafael Mendonça França*
  6
+
4 7
 
5 8
 ## Rails 3.2.7 (Jul 26, 2012) ##
6 9
 
7  
-* Since Rails 3.2, use layout false to render no layout
8  
-* Use strict_args_position! if available from Thor
  10
+*   Since Rails 3.2, use layout false to render no layout
  11
+*   Use strict_args_position! if available from Thor
  12
+
9 13
 
10 14
 ## Rails 3.2.6 (Jun 12, 2012) ##
11 15
 
12 16
 *   No changes.
13 17
 
  18
+
14 19
 ## Rails 3.2.4 (May 31, 2012) ##
15 20
 
16 21
 *   Add hook for resource route's generator. *Santiago Pastorino*
2  railties/lib/rails/generators/erb/scaffold/templates/index.html.erb
@@ -17,7 +17,7 @@
17 17
 <% end -%>
18 18
     <td><%%= link_to 'Show', <%= singular_table_name %> %></td>
19 19
     <td><%%= link_to 'Edit', edit_<%= singular_table_name %>_path(<%= singular_table_name %>) %></td>
20  
-    <td><%%= link_to 'Destroy', <%= singular_table_name %>, <%= key_value :confirm, "'Are you sure?'" %>, <%= key_value :method, ":delete" %> %></td>
  20
+    <td><%%= link_to 'Destroy', <%= singular_table_name %>, <%= key_value :method, ":delete" %>, <%= key_value :data, "{ #{key_value :confirm, "'Are you sure?'"} }" %> %></td>
21 21
   </tr>
22 22
 <%% end %>
23 23
 </table>
2  railties/lib/rails/version.rb
@@ -3,7 +3,7 @@ module VERSION #:nodoc:
3 3
     MAJOR = 3
4 4
     MINOR = 2
5 5
     TINY  = 8
6  
-    PRE   = "rc1"
  6
+    PRE   = "rc2"
7 7
 
8 8
     STRING = [MAJOR, MINOR, TINY, PRE].compact.join('.')
9 9
   end
4  railties/test/application/assets_test.rb
@@ -230,7 +230,7 @@ def show_detailed_exceptions?() true end
230 230
 
231 231
       get '/posts'
232 232
       assert_match(/AssetNotPrecompiledError/, last_response.body)
233  
-      assert_match(/app.js isn't precompiled/, last_response.body)
  233
+      assert_match(/app.js isn&#x27;t precompiled/, last_response.body)
234 234
     end
235 235
 
236 236
     test "assets raise AssetNotPrecompiledError when manifest file is present and requested file isn't precompiled if digest is disabled" do
@@ -254,7 +254,7 @@ class ::PostsController < ActionController::Base ; end
254 254
 
255 255
       get '/posts'
256 256
       assert_match(/AssetNotPrecompiledError/, last_response.body)
257  
-      assert_match(/app.js isn't precompiled/, last_response.body)
  257
+      assert_match(/app.js isn&#x27;t precompiled/, last_response.body)
258 258
     end
259 259
 
260 260
     test "precompile properly refers files referenced with asset_path and and run in the provided RAILS_ENV" do
2  version.rb
@@ -3,7 +3,7 @@ module VERSION #:nodoc:
3 3
     MAJOR = 3
4 4
     MINOR = 2
5 5
     TINY  = 8
6  
-    PRE   = "rc1"
  6
+    PRE   = "rc2"
7 7
 
8 8
     STRING = [MAJOR, MINOR, TINY, PRE].compact.join('.')
9 9
   end

No commit comments for this range

Something went wrong with that request. Please try again.