Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: rails/rails
...
head fork: rails/rails
Checking mergeability… Don't worry, you can still create the pull request.
  • 17 commits
  • 41 files changed
  • 3 commit comments
  • 4 contributors
Commits on May 24, 2010
@jeremy jeremy Bump 2-3-stable to 2.3.8 f97da34
@jeremy jeremy Fix that captured content (e.g. with form_for or div_for) would be HT…
…ML-escaped even without the rails_xss plugin installed. Rails 2.3.7, we barely knew ya...
c66013e
@wycats wycats Give the ERB String the encoding of the original template 50b7c0c
@wycats wycats Needs to work on 1.8 too 8e6a044
@spastorino spastorino Revert "translation method of TranslationHelper module returns always…
… SafeBuffer [#4194 status:resolved]"

This reverts commit 2310aef.

Signed-off-by: José Valim <jose.valim@gmail.com>
d3da1a2
@spastorino spastorino translation method of TranslationHelper module returns a SafeBuffer A…
…rray backport

[#4675 state:committed]

Signed-off-by: José Valim <jose.valim@gmail.com>
6b0616d
@jeremy jeremy Work around strange Ruby 1.9 autoload issue by using absolute load pa…
…ths for tests
9d3bd87
@jeremy jeremy Add global gem task e5af56a
@jeremy jeremy 2.3.7.pre1: fixes HTML escaping when *not* using rails_xss 4fef5af
@spastorino spastorino translate helper method using an array is deprecated
Signed-off-by: José Valim <jose.valim@gmail.com>
4986d5e
@josevalim josevalim Ensure translations work with symbols. 50f3754
@jeremy jeremy Work around strange Ruby 1.9 autoload issue by using absolute load pa…
…ths for tests (ditto for other components' tests)
e8ba526
@spastorino spastorino Error messages for asserts
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
a9032c8
@jeremy jeremy Work around strange Ruby 1.9 autoload issue by using absolute load pa…
…ths for tests (for Active Model too)
aa44914
Commits on May 25, 2010
@jeremy jeremy HTML safety: fix textarea with nil content 6a9e188
@jeremy jeremy i18n: t() handles single keys returning an Array, also f7e27bd
@spastorino spastorino SQLite: forward compatibility with future driver releases
[#4633]

Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
240f4e9
Showing with 200 additions and 87 deletions.
  1. +1 −1  Rakefile
  2. +5 −0 actionmailer/CHANGELOG
  3. +1 −1  actionmailer/Rakefile
  4. +1 −1  actionmailer/lib/action_mailer/version.rb
  5. +3 −3 actionmailer/test/abstract_unit.rb
  6. +5 −0 actionpack/CHANGELOG
  7. +1 −1  actionpack/Rakefile
  8. +1 −1  actionpack/lib/action_pack/version.rb
  9. +1 −1  actionpack/lib/action_view/helpers/capture_helper.rb
  10. +1 −1  actionpack/lib/action_view/helpers/form_tag_helper.rb
  11. +36 −10 actionpack/lib/action_view/helpers/translation_helper.rb
  12. +5 −0 actionpack/lib/action_view/template_handlers/erb.rb
  13. +1 −1  actionpack/lib/action_view/test_case.rb
  14. +5 −5 actionpack/test/abstract_unit.rb
  15. +1 −1  actionpack/test/active_record_unit.rb
  16. +5 −5 actionpack/test/controller/assert_select_test.rb
  17. +1 −1  actionpack/test/controller/capture_test.rb
  18. +1 −1  actionpack/test/controller/helper_test.rb
  19. +1 −1  actionpack/test/fixtures/test/array_translation.erb
  20. +2 −2 actionpack/test/fixtures/test/capturing.erb
  21. +1 −1  actionpack/test/fixtures/test/scoped_array_translation.erb
  22. +1 −0  actionpack/test/fixtures/test/translation.erb
  23. +6 −0 actionpack/test/template/form_tag_helper_test.rb
  24. +64 −19 actionpack/test/template/translation_helper_test.rb
  25. +1 −1  activemodel/test/test_helper.rb
  26. +5 −0 activerecord/CHANGELOG
  27. +1 −1  activerecord/Rakefile
  28. +3 −3 activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb
  29. +1 −1  activerecord/lib/active_record/version.rb
  30. +5 −0 activeresource/CHANGELOG
  31. +1 −1  activeresource/Rakefile
  32. +1 −1  activeresource/lib/active_resource/version.rb
  33. +2 −2 activeresource/test/abstract_unit.rb
  34. +5 −0 activesupport/CHANGELOG
  35. +1 −1  activesupport/lib/active_support/version.rb
  36. +1 −1  activesupport/test/abstract_unit.rb
  37. +6 −6 activesupport/test/buffered_logger_test.rb
  38. +5 −0 railties/CHANGELOG
  39. +5 −5 railties/Rakefile
  40. +1 −1  railties/lib/rails/version.rb
  41. +6 −6 railties/test/abstract_unit.rb
View
2  Rakefile
@@ -12,7 +12,7 @@ end
desc 'Run all tests by default'
task :default => :test
-%w(test rdoc pgem package release).each do |task_name|
+%w(test rdoc pgem package release gem).each do |task_name|
desc "Run #{task_name} task for all projects"
task task_name do
PROJECTS.each do |project|
View
5 actionmailer/CHANGELOG
@@ -1,3 +1,8 @@
+*2.3.8 (May 24, 2010)*
+
+* Version bump.
+
+
*2.3.7 (May 24, 2010)*
* Version bump.
View
2  actionmailer/Rakefile
@@ -54,7 +54,7 @@ spec = Gem::Specification.new do |s|
s.rubyforge_project = "actionmailer"
s.homepage = "http://www.rubyonrails.org"
- s.add_dependency('actionpack', '= 2.3.7' + PKG_BUILD)
+ s.add_dependency('actionpack', '= 2.3.8' + PKG_BUILD)
s.has_rdoc = true
s.requirements << 'none'
View
2  actionmailer/lib/action_mailer/version.rb
@@ -2,7 +2,7 @@ module ActionMailer
module VERSION #:nodoc:
MAJOR = 2
MINOR = 3
- TINY = 7
+ TINY = 8
STRING = [MAJOR, MINOR, TINY].join('.')
end
View
6 actionmailer/test/abstract_unit.rb
@@ -1,9 +1,9 @@
require 'rubygems'
require 'test/unit'
-$:.unshift "#{File.dirname(__FILE__)}/../lib"
-$:.unshift "#{File.dirname(__FILE__)}/../../activesupport/lib"
-$:.unshift "#{File.dirname(__FILE__)}/../../actionpack/lib"
+$:.unshift File.expand_path('../../lib', __FILE__)
+$:.unshift File.expand_path('../../../activesupport/lib', __FILE__)
+$:.unshift File.expand_path('../../../actionpack/lib', __FILE__)
require 'action_mailer'
require 'action_mailer/test_case'
View
5 actionpack/CHANGELOG
@@ -1,3 +1,8 @@
+*2.3.8 (May 24, 2010)*
+
+* HTML safety: fix compatibility *without* the optional rails_xss plugin.
+
+
*2.3.7 (May 24, 2010)*
* HTML safety: fix compatibility with the optional rails_xss plugin. [Nathan Weizenbaum, Santiago Pastorino]
View
2  actionpack/Rakefile
@@ -79,7 +79,7 @@ spec = Gem::Specification.new do |s|
s.has_rdoc = true
s.requirements << 'none'
- s.add_dependency('activesupport', '= 2.3.7' + PKG_BUILD)
+ s.add_dependency('activesupport', '= 2.3.8' + PKG_BUILD)
s.add_dependency('rack', '~> 1.1.0')
s.require_path = 'lib'
View
2  actionpack/lib/action_pack/version.rb
@@ -2,7 +2,7 @@ module ActionPack #:nodoc:
module VERSION #:nodoc:
MAJOR = 2
MINOR = 3
- TINY = 7
+ TINY = 8
STRING = [MAJOR, MINOR, TINY].join('.')
end
View
2  actionpack/lib/action_view/helpers/capture_helper.rb
@@ -124,7 +124,7 @@ def content_for(name, content = nil, &block)
# Use an alternate output buffer for the duration of the block.
# Defaults to a new empty string.
- def with_output_buffer(buf = ActiveSupport::SafeBuffer.new) #:nodoc:
+ def with_output_buffer(buf = '') #:nodoc:
self.output_buffer, old_buffer = buf, output_buffer
yield
output_buffer
View
2  actionpack/lib/action_view/helpers/form_tag_helper.rb
@@ -265,7 +265,7 @@ def text_area_tag(name, content = nil, options = {})
escape = options.key?("escape") ? options.delete("escape") : true
content = html_escape(content) if escape
- content_tag :textarea, content.html_safe, { "name" => name, "id" => sanitize_to_id(name) }.update(options.stringify_keys)
+ content_tag :textarea, content.to_s.html_safe, { "name" => name, "id" => sanitize_to_id(name) }.update(options.stringify_keys)
end
# Creates a check box form input tag.
View
46 actionpack/lib/action_view/helpers/translation_helper.rb
@@ -3,17 +3,30 @@
module ActionView
module Helpers
module TranslationHelper
- # Delegates to I18n#translate but also performs two additional functions. First, it'll catch MissingTranslationData exceptions
+ # Delegates to I18n#translate but also performs two additional functions. First, it'll catch MissingTranslationData exceptions
# and turn them into inline spans that contains the missing key, such that you can see in a view what is missing where.
#
# Second, it'll scope the key by the current partial if the key starts with a period. So if you call translate(".foo") from the
# people/index.html.erb template, you'll actually be calling I18n.translate("people.index.foo"). This makes it less repetitive
# to translate many keys within the same partials and gives you a simple framework for scoping them consistently. If you don't
# prepend the key with a period, nothing is converted.
- def translate(key, options = {})
+ def translate(keys, options = {})
+ if multiple_keys = keys.is_a?(Array)
+ ActiveSupport::Deprecation.warn "Giving an array to translate is deprecated, please give a symbol or a string instead", caller
+ end
+
options[:raise] = true
- translation = I18n.translate(scope_key_by_partial(key), options)
- (translation.respond_to?(:join) ? translation.join : translation).html_safe
+ keys = scope_keys_by_partial(keys)
+
+ translations = I18n.translate(keys, options)
+ translations = [translations] if !multiple_keys && translations.size > 1
+ translations = html_safe_translation_keys(keys, translations)
+
+ if multiple_keys || translations.size > 1
+ translations
+ else
+ translations.first
+ end
rescue I18n::MissingTranslationData => e
keys = I18n.send(:normalize_translation_keys, e.locale, e.key, e.options[:scope])
content_tag('span', keys.join(', '), :class => 'translation_missing')
@@ -28,12 +41,25 @@ def localize(*args)
private
- def scope_key_by_partial(key)
- strkey = key.respond_to?(:join) ? key.join : key.to_s
- if strkey.first == "."
- template.path_without_format_and_extension.gsub(%r{/_?}, ".") + strkey
- else
- key
+ def scope_keys_by_partial(keys)
+ Array.wrap(keys).map do |key|
+ key = key.to_s
+
+ if key.first == "."
+ template.path_without_format_and_extension.gsub(%r{/_?}, ".") + key
+ else
+ key
+ end
+ end
+ end
+
+ def html_safe_translation_keys(keys, translations)
+ keys.zip(translations).map do |key, translation|
+ if key =~ /(\b|_|\.)html$/ && translation.respond_to?(:html_safe)
+ translation.html_safe
+ else
+ translation
+ end
end
end
end
View
5 actionpack/lib/action_view/template_handlers/erb.rb
@@ -13,6 +13,11 @@ class ERB < TemplateHandler
def compile(template)
magic = $1 if template.source =~ /\A(<%#.*coding[:=]\s*(\S+)\s*-?%>)/
erb = "#{magic}<% __in_erb_template=true %>#{template.source}"
+
+ if erb.respond_to?(:force_encoding)
+ erb.force_encoding(template.source.encoding)
+ end
+
::ERB.new(erb, nil, erb_trim_mode, '@output_buffer').src
end
end
View
2  actionpack/lib/action_view/test_case.rb
@@ -53,7 +53,7 @@ def initialize
setup :setup_with_controller
def setup_with_controller
@controller = TestController.new
- @output_buffer = ''.html_safe
+ @output_buffer = ''
@rendered = ''
self.class.send(:include_helper_modules!)
View
10 actionpack/test/abstract_unit.rb
@@ -1,7 +1,7 @@
-$:.unshift(File.dirname(__FILE__) + '/../lib')
-$:.unshift(File.dirname(__FILE__) + '/../../activesupport/lib')
-$:.unshift(File.dirname(__FILE__) + '/fixtures/helpers')
-$:.unshift(File.dirname(__FILE__) + '/fixtures/alternate_helpers')
+$:.unshift File.expand_path('../../lib', __FILE__)
+$:.unshift File.expand_path('../../../activesupport/lib', __FILE__)
+$:.unshift File.expand_path('../fixtures/helpers', __FILE__)
+$:.unshift File.expand_path('../fixtures/alternate_helpers', __FILE__)
require 'rubygems'
require 'yaml'
@@ -58,4 +58,4 @@ def locked?
end
end
-ActionController::Reloader.default_lock = DummyMutex.new
+ActionController::Reloader.default_lock = DummyMutex.new
View
2  actionpack/test/active_record_unit.rb
@@ -16,7 +16,7 @@ class ActiveRecordTestConnector
else
$stderr.print 'Attempting to load Active Record... '
begin
- PATH_TO_AR = "#{File.dirname(__FILE__)}/../../activerecord/lib"
+ PATH_TO_AR = File.expand_path('../../../activerecord/lib', __FILE__)
raise LoadError, "#{PATH_TO_AR} doesn't exist" unless File.directory?(PATH_TO_AR)
$LOAD_PATH.unshift PATH_TO_AR
require 'active_record'
View
10 actionpack/test/controller/assert_select_test.rb
@@ -210,13 +210,13 @@ def test_assert_select_text_match
assert_nothing_raised { assert_select "div", "foo" }
assert_nothing_raised { assert_select "div", "bar" }
assert_nothing_raised { assert_select "div", /\w*/ }
- assert_nothing_raised { assert_select "div", /\w*/, :count=>2 }
- assert_raise(Assertion) { assert_select "div", :text=>"foo", :count=>2 }
+ assert_nothing_raised { assert_select "div", :text => /\w*/, :count=>2 }
+ assert_raise(Assertion) { assert_select "div", :text=>"foo", :count=>2 }
assert_nothing_raised { assert_select "div", :html=>"<span>bar</span>" }
assert_nothing_raised { assert_select "div", :html=>"<span>bar</span>" }
assert_nothing_raised { assert_select "div", :html=>/\w*/ }
assert_nothing_raised { assert_select "div", :html=>/\w*/, :count=>2 }
- assert_raise(Assertion) { assert_select "div", :html=>"<span>foo</span>", :count=>2 }
+ assert_raise(Assertion) { assert_select "div", :html=>"<span>foo</span>", :count=>2 }
end
end
@@ -268,8 +268,8 @@ def test_elect_with_xml_namespace_attributes
def test_css_select
render_html %Q{<div id="1"></div><div id="2"></div>}
- assert 2, css_select("div").size
- assert 0, css_select("p").size
+ assert_equal 2, css_select("div").size
+ assert_equal 0, css_select("p").size
end
def test_nested_css_select
View
2  actionpack/test/controller/capture_test.rb
@@ -36,7 +36,7 @@ def setup
def test_simple_capture
get :capturing
- assert_equal "Dreamy days", @response.body.strip
+ assert_equal "<p>Dreamy days</p>", @response.body.strip
end
def test_content_for
View
2  actionpack/test/controller/helper_test.rb
@@ -87,7 +87,7 @@ def test_helper_block_include
assert_nothing_raised {
@controller_class.helper { include HelperTest::TestHelper }
}
- assert [], missing_methods
+ assert_equal [], missing_methods
end
def test_helper_method
View
2  actionpack/test/fixtures/test/array_translation.erb
@@ -1 +1 @@
-<%= t(['foo', 'bar']) %>
+<% translation = t(['foo', 'bar', 'baz_html']) %><%= translation.first %>, <%= translation.second %>, <%= translation.third %>
View
4 actionpack/test/fixtures/test/capturing.erb
@@ -1,4 +1,4 @@
<% days = capture do %>
- Dreamy days
+ <p>Dreamy days</p>
<% end %>
-<%= days %>
+<%= days %>
View
2  actionpack/test/fixtures/test/scoped_array_translation.erb
@@ -1 +1 @@
-<%= t(['.foo', '.bar']) %>
+<%= t(['.foo', '.bar']).join(", ") %>
View
1  actionpack/test/fixtures/test/translation.erb
@@ -0,0 +1 @@
+<%= t('.helper') %>
View
6 actionpack/test/template/form_tag_helper_test.rb
@@ -176,6 +176,12 @@ def test_text_area_tag_unescaped_content
assert_dom_equal expected, actual
end
+ def test_text_area_tag_unescaped_nil_content
+ actual = text_area_tag "body", nil, :escape => false
+ expected = %(<textarea id="body" name="body"></textarea>)
+ assert_dom_equal expected, actual
+ end
+
def test_text_field_tag
actual = text_field_tag "title", "Hello!"
expected = %(<input id="title" name="title" type="text" value="Hello!" />)
View
83 actionpack/test/template/translation_helper_test.rb
@@ -1,33 +1,50 @@
require 'abstract_unit'
-class TranslationHelperTest < Test::Unit::TestCase
+class TranslationHelperTest < ActiveSupport::TestCase
include ActionView::Helpers::TagHelper
include ActionView::Helpers::TranslationHelper
-
+
attr_reader :request
def setup
end
-
+
def test_delegates_to_i18n_setting_the_raise_option
- I18n.expects(:translate).with(:foo, :locale => 'en', :raise => true).returns("")
+ I18n.expects(:translate).with(['foo'], :locale => 'en', :raise => true).returns([""])
translate :foo, :locale => 'en'
end
-
+
def test_returns_missing_translation_message_wrapped_into_span
expected = '<span class="translation_missing">en, foo</span>'
assert_equal expected, translate(:foo)
end
-
+
+ def test_translation_returning_an_array
+ I18n.expects(:translate).with(["foo"], :raise => true).returns(["foo", "bar"])
+ assert_equal ["foo", "bar"], translate(:foo)
+ end
+
def test_translation_of_an_array
- I18n.expects(:translate).with(["foo", "bar"], :raise => true).returns(["foo", "bar"])
- assert_equal "foobar", translate(["foo", "bar"])
+ assert_deprecated do
+ I18n.expects(:translate).with(["foo", "bar"], :raise => true).returns(["foo", "bar"])
+ assert_equal ["foo", "bar"], translate(["foo", "bar"])
+ end
+ end
+
+ def test_translation_of_an_array_returning_an_array
+ assert_deprecated do
+ I18n.expects(:translate).with(["foo", "bar"], :raise => true).returns(["foo", ["bar", "baz"]])
+ assert_equal ["foo", ["bar", "baz"]], translate(["foo", "bar"])
+ end
end
def test_translation_of_an_array_with_html
- expected = '<a href="#">foo</a><a href="#">bar</a>'
- I18n.expects(:translate).with(["foo", "bar"], :raise => true).returns(['<a href="#">foo</a>', '<a href="#">bar</a>'])
- @view = ActionView::Base.new(ActionController::Base.view_paths, {})
- assert_equal expected, @view.render(:file => "test/array_translation")
+ assert_deprecated do
+ translate_expected = ['<a href="#">foo</a>', '<a href="#">bar</a>', '<a href="#">baz</a>']
+ I18n.expects(:translate).with(["foo", "bar", "baz_html"], :raise => true).returns(translate_expected)
+ @view = ActionView::Base.new(ActionController::Base.view_paths, {})
+ expected = '<a href="#">foo</a>, <a href="#">bar</a>, <a href="#">baz</a>'
+ assert_equal expected, @view.render(:file => "test/array_translation")
+ end
end
def test_delegates_localize_to_i18n
@@ -35,16 +52,44 @@ def test_delegates_localize_to_i18n
I18n.expects(:localize).with(@time)
localize @time
end
-
+
def test_scoping_by_partial
- expects(:template).returns(stub(:path_without_format_and_extension => "people/index"))
- I18n.expects(:translate).with("people.index.foo", :locale => 'en', :raise => true).returns("")
- translate ".foo", :locale => 'en'
+ I18n.expects(:translate).with(["test.translation.helper"], :raise => true).returns(["helper"])
+ @view = ActionView::Base.new(ActionController::Base.view_paths, {})
+ assert_equal "helper", @view.render(:file => "test/translation")
end
def test_scoping_by_partial_of_an_array
- I18n.expects(:translate).with("test.scoped_array_translation.foo.bar", :raise => true).returns(["foo", "bar"])
- @view = ActionView::Base.new(ActionController::Base.view_paths, {})
- assert_equal "foobar", @view.render(:file => "test/scoped_array_translation")
+ assert_deprecated do
+ I18n.expects(:translate).with(["test.scoped_array_translation.foo", "test.scoped_array_translation.bar"], :raise => true).returns(["foo", "bar"])
+ @view = ActionView::Base.new(ActionController::Base.view_paths, {})
+ assert_equal "foo, bar", @view.render(:file => "test/scoped_array_translation")
+ end
+ end
+
+ def test_translate_works_with_symbols
+ I18n.expects(:translate).with(["hello"], :raise => true).returns(["Hello World"])
+ assert_equal "Hello World", translate(:hello)
+ end
+
+
+ def test_translate_does_not_mark_plain_text_as_safe_html
+ I18n.expects(:translate).with(["hello"], :raise => true).returns(["Hello World"])
+ assert_equal false, translate("hello").html_safe?
+ end
+
+ def test_translate_marks_translations_named_html_as_safe_html
+ I18n.expects(:translate).with(["html"], :raise => true).returns(["<a>Hello World</a>"])
+ assert translate("html").html_safe?
+ end
+
+ def test_translate_marks_translations_with_a_html_suffix_as_safe_html
+ I18n.expects(:translate).with(["hello_html"], :raise => true).returns(["<a>Hello World</a>"])
+ assert translate("hello_html").html_safe?
+ end
+
+ def test_translation_returning_an_array_ignores_html_suffix
+ I18n.expects(:translate).with(["foo_html"], :raise => true).returns(["foo", "bar"])
+ assert_equal ["foo", "bar"], translate(:foo_html)
end
end
View
2  activemodel/test/test_helper.rb
@@ -7,7 +7,7 @@
require 'active_model'
require 'active_model/state_machine'
-$:.unshift File.dirname(__FILE__) + "/../../activesupport/lib"
+$:.unshift File.expand_path('../../../activesupport/lib', __FILE__)
require 'active_support'
require 'active_support/test_case'
View
5 activerecord/CHANGELOG
@@ -1,3 +1,8 @@
+*2.3.8 (May 24, 2010)*
+
+* Version bump.
+
+
*2.3.7 (May 24, 2010)*
* Version bump.
View
2  activerecord/Rakefile
@@ -192,7 +192,7 @@ spec = Gem::Specification.new do |s|
s.files = s.files + Dir.glob( "#{dir}/**/*" ).delete_if { |item| item.include?( "\.svn" ) }
end
- s.add_dependency('activesupport', '= 2.3.7' + PKG_BUILD)
+ s.add_dependency('activesupport', '= 2.3.8' + PKG_BUILD)
s.files.delete FIXTURES_ROOT + "/fixture_database.sqlite"
s.files.delete FIXTURES_ROOT + "/fixture_database_2.sqlite"
View
6 activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb
@@ -220,20 +220,20 @@ def tables(name = nil) #:nodoc:
SQL
execute(sql, name).map do |row|
- row[0]
+ row['name']
end
end
def columns(table_name, name = nil) #:nodoc:
table_structure(table_name).map do |field|
- SQLiteColumn.new(field['name'], field['dflt_value'], field['type'], field['notnull'] == "0")
+ SQLiteColumn.new(field['name'], field['dflt_value'], field['type'], field['notnull'].to_i == 0)
end
end
def indexes(table_name, name = nil) #:nodoc:
execute("PRAGMA index_list(#{quote_table_name(table_name)})", name).map do |row|
index = IndexDefinition.new(table_name, row['name'])
- index.unique = row['unique'] != '0'
+ index.unique = row['unique'].to_i != 0
index.columns = execute("PRAGMA index_info('#{index.name}')").map { |col| col['name'] }
index
end
View
2  activerecord/lib/active_record/version.rb
@@ -2,7 +2,7 @@ module ActiveRecord
module VERSION #:nodoc:
MAJOR = 2
MINOR = 3
- TINY = 7
+ TINY = 8
STRING = [MAJOR, MINOR, TINY].join('.')
end
View
5 activeresource/CHANGELOG
@@ -1,3 +1,8 @@
+*2.3.8 (May 24, 2010)*
+
+* Version bump.
+
+
*2.3.7 (May 24, 2010)*
* Version bump.
View
2  activeresource/Rakefile
@@ -66,7 +66,7 @@ spec = Gem::Specification.new do |s|
s.files = s.files + Dir.glob( "#{dir}/**/*" ).delete_if { |item| item.include?( "\.svn" ) }
end
- s.add_dependency('activesupport', '= 2.3.7' + PKG_BUILD)
+ s.add_dependency('activesupport', '= 2.3.8' + PKG_BUILD)
s.require_path = 'lib'
s.autorequire = 'active_resource'
View
2  activeresource/lib/active_resource/version.rb
@@ -2,7 +2,7 @@ module ActiveResource
module VERSION #:nodoc:
MAJOR = 2
MINOR = 3
- TINY = 7
+ TINY = 8
STRING = [MAJOR, MINOR, TINY].join('.')
end
View
4 activeresource/test/abstract_unit.rb
@@ -2,8 +2,8 @@
require 'test/unit'
require 'active_support/test_case'
-$:.unshift "#{File.dirname(__FILE__)}/../lib"
-$:.unshift "#{File.dirname(__FILE__)}/../../activesupport/lib"
+$:.unshift File.expand_path('../../lib', __FILE__)
+$:.unshift File.expand_path('../../../activesupport/lib', __FILE__)
require 'active_resource'
require 'active_resource/http_mock'
View
5 activesupport/CHANGELOG
@@ -1,3 +1,8 @@
+*2.3.8 (May 24, 2010)*
+
+* Version bump.
+
+
*2.3.7 (May 24, 2010)*
* HTML safety: fix compatibility with the optional rails_xss plugin. [Nathan Weizenbaum, Santiago Pastorino]
View
2  activesupport/lib/active_support/version.rb
@@ -2,7 +2,7 @@ module ActiveSupport
module VERSION #:nodoc:
MAJOR = 2
MINOR = 3
- TINY = 7
+ TINY = 8
STRING = [MAJOR, MINOR, TINY].join('.')
end
View
2  activesupport/test/abstract_unit.rb
@@ -4,7 +4,7 @@
ENV['NO_RELOAD'] = '1'
-$:.unshift "#{File.dirname(__FILE__)}/../lib"
+$:.unshift File.expand_path('../../lib', __FILE__)
require 'active_support'
require 'active_support/test_case'
View
12 activesupport/test/buffered_logger_test.rb
@@ -66,11 +66,11 @@ def test_should_not_mutate_message
4.times do
@logger.info 'wait for it..'
- assert @output.string.empty?, @output.string
+ assert @output.string.empty?, "@output.string should be empty but it is #{@output.string}"
end
@logger.flush
- assert !@output.string.empty?, @logger.send(:buffer).size
+ assert !@output.string.empty?, "@logger.send(:buffer).size.to_s should not be empty but it is empty"
end
define_method "test_disabling_auto_flush_with_#{disable.inspect}_should_flush_at_max_buffer_size_as_failsafe" do
@@ -79,11 +79,11 @@ def test_should_not_mutate_message
(ActiveSupport::BufferedLogger::MAX_BUFFER_SIZE - 1).times do
@logger.info 'wait for it..'
- assert @output.string.empty?, @output.string
+ assert @output.string.empty?, "@output.string should be empty but is #{@output.string}"
end
@logger.info 'there it is.'
- assert !@output.string.empty?, @logger.send(:buffer).size
+ assert !@output.string.empty?, "@logger.send(:buffer).size.to_s should not be empty but it is empty"
end
end
@@ -99,11 +99,11 @@ def test_should_auto_flush_every_n_messages
4.times do
@logger.info 'wait for it..'
- assert @output.string.empty?, @output.string
+ assert @output.string.empty?, "@output.string should be empty but it is #{@output.string}"
end
@logger.info 'there it is.'
- assert !@output.string.empty?, @output.string
+ assert !@output.string.empty?, "@output.string should not be empty but it is empty"
end
def test_should_create_the_log_directory_if_it_doesnt_exist
View
5 railties/CHANGELOG
@@ -1,3 +1,8 @@
+*2.3.8 (May 24, 2010)*
+
+* Version bump.
+
+
*2.3.7 (May 24, 2010)*
* Version bump.
View
10 railties/Rakefile
@@ -314,11 +314,11 @@ spec = Gem::Specification.new do |s|
EOF
s.add_dependency('rake', '>= 0.8.3')
- s.add_dependency('activesupport', '= 2.3.7' + PKG_BUILD)
- s.add_dependency('activerecord', '= 2.3.7' + PKG_BUILD)
- s.add_dependency('actionpack', '= 2.3.7' + PKG_BUILD)
- s.add_dependency('actionmailer', '= 2.3.7' + PKG_BUILD)
- s.add_dependency('activeresource', '= 2.3.7' + PKG_BUILD)
+ s.add_dependency('activesupport', '= 2.3.8' + PKG_BUILD)
+ s.add_dependency('activerecord', '= 2.3.8' + PKG_BUILD)
+ s.add_dependency('actionpack', '= 2.3.8' + PKG_BUILD)
+ s.add_dependency('actionmailer', '= 2.3.8' + PKG_BUILD)
+ s.add_dependency('activeresource', '= 2.3.8' + PKG_BUILD)
s.rdoc_options << '--exclude' << '.'
s.has_rdoc = false
View
2  railties/lib/rails/version.rb
@@ -2,7 +2,7 @@ module Rails
module VERSION #:nodoc:
MAJOR = 2
MINOR = 3
- TINY = 7
+ TINY = 8
STRING = [MAJOR, MINOR, TINY].join('.')
end
View
12 railties/test/abstract_unit.rb
@@ -1,9 +1,9 @@
-$:.unshift File.dirname(__FILE__) + "/../../activesupport/lib"
-$:.unshift File.dirname(__FILE__) + "/../../activerecord/lib"
-$:.unshift File.dirname(__FILE__) + "/../../actionpack/lib"
-$:.unshift File.dirname(__FILE__) + "/../../actionmailer/lib"
-$:.unshift File.dirname(__FILE__) + "/../lib"
-$:.unshift File.dirname(__FILE__) + "/../builtin/rails_info"
+$:.unshift File.expand_path('../../../activesupport/lib', __FILE__)
+$:.unshift File.expand_path('../../../activerecord/lib', __FILE__)
+$:.unshift File.expand_path('../../../actionpack/lib', __FILE__)
+$:.unshift File.expand_path('../../../actionmailer/lib', __FILE__)
+$:.unshift File.expand_path('../../lib', __FILE__)
+$:.unshift File.expand_path('../../builtin/rails_info', __FILE__)
require 'stringio'
require 'rubygems'

Showing you all comments on commits in this comparison.

@jm3

Dreamy days.

@nicolasblanco

If translations is an empty string "" or "\n", it does not get wrapped in an array and html_safe_translation_keys fails with TypeError: can't convert String into Array!

All my I18n applications now fails everytime there is a translation that returns an empty string.

@nicolasblanco

sorry this is maybe the fault of my i18n backend, it was returning a string instead of an array of translations when calling I18n.translate with an array in parameter.

Something went wrong with that request. Please try again.