aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--actionpack/test/template/text_helper_test.rb8
-rw-r--r--activerecord/CHANGELOG2
-rwxr-xr-xactiverecord/lib/active_record/validations.rb6
-rwxr-xr-xactiverecord/test/validations_test.rb28
-rw-r--r--railties/lib/tasks/databases.rake2
5 files changed, 22 insertions, 24 deletions
diff --git a/actionpack/test/template/text_helper_test.rb b/actionpack/test/template/text_helper_test.rb
index d1ef946f29..0333e974b8 100644
--- a/actionpack/test/template/text_helper_test.rb
+++ b/actionpack/test/template/text_helper_test.rb
@@ -1,9 +1,5 @@
-require 'test/unit'
+require File.dirname(__FILE__) + '/../abstract_unit'
require "#{File.dirname(__FILE__)}/../testing_sandbox"
-require File.dirname(__FILE__) + '/../../lib/action_view/helpers/text_helper'
-require File.dirname(__FILE__) + '/../../../activesupport/lib/active_support/core_ext/numeric' # for human_size
-require File.dirname(__FILE__) + '/../../../activesupport/lib/active_support/core_ext/hash' # for stringify_keys
-require File.dirname(__FILE__) + '/../../../activesupport/lib/active_support/core_ext/object.rb' # for blank?
class TextHelperTest < Test::Unit::TestCase
include ActionView::Helpers::TextHelper
@@ -29,6 +25,7 @@ class TextHelperTest < Test::Unit::TestCase
def test_truncate_multibyte_without_kcode
result = execute_in_sandbox(<<-'CODE')
+ require File.dirname(__FILE__) + '/../../activesupport/lib/active_support/core_ext/kernel'
require "#{File.dirname(__FILE__)}/../lib/action_view/helpers/text_helper"
include ActionView::Helpers::TextHelper
truncate("\354\225\210\353\205\225\355\225\230\354\204\270\354\232\224", 10)
@@ -42,6 +39,7 @@ class TextHelperTest < Test::Unit::TestCase
$KCODE = "u"
require 'jcode'
+ require File.dirname(__FILE__) + '/../../activesupport/lib/active_support/core_ext/kernel'
require "#{File.dirname(__FILE__)}/../lib/action_view/helpers/text_helper"
include ActionView::Helpers::TextHelper
truncate("\354\225\204\353\246\254\353\236\221 \354\225\204\353\246\254\353\236 \354\225\204\353\235\274\353\246\254\354\230\244", 10)
diff --git a/activerecord/CHANGELOG b/activerecord/CHANGELOG
index 944c4acf2a..f90ba96bd1 100644
--- a/activerecord/CHANGELOG
+++ b/activerecord/CHANGELOG
@@ -2106,7 +2106,7 @@ in effect. Added :readonly finder constraint. Calling an association collectio
end
end
- This will add an error to the tune of "is too short (min is 3 characters)" or "is too long (min is 20 characters)" if
+ This will add an error to the tune of "is too short (minimum is 3 characters)" or "is too long (minimum is 20 characters)" if
the password is outside the boundry. The messages can be changed by passing a third and forth parameter as message strings.
* Implemented a clone method that works properly with AR. It returns a clone of the record that
diff --git a/activerecord/lib/active_record/validations.rb b/activerecord/lib/active_record/validations.rb
index e206dfbbf1..c5c38ff4fd 100755
--- a/activerecord/lib/active_record/validations.rb
+++ b/activerecord/lib/active_record/validations.rb
@@ -31,8 +31,8 @@ module ActiveRecord
:accepted => "must be accepted",
:empty => "can't be empty",
:blank => "can't be blank",
- :too_long => "is too long (max is %d characters)",
- :too_short => "is too short (min is %d characters)",
+ :too_long => "is too long (maximum is %d characters)",
+ :too_short => "is too short (minimum is %d characters)",
:wrong_length => "is the wrong length (should be %d characters)",
:taken => "has already been taken",
:not_a_number => "is not a number"
@@ -415,7 +415,7 @@ module ActiveRecord
# * <tt>in</tt> - A synonym(or alias) for :within
# * <tt>allow_nil</tt> - Attribute may be nil; skip validation.
#
- # * <tt>too_long</tt> - The error message if the attribute goes over the maximum (default is: "is too long (max is %d characters)")
+ # * <tt>too_long</tt> - The error message if the attribute goes over the maximum (default is: "is too long (maximum is %d characters)")
# * <tt>too_short</tt> - The error message if the attribute goes under the minimum (default is: "is too short (min is %d characters)")
# * <tt>wrong_length</tt> - The error message if using the :is method and the attribute is the wrong size (default is: "is the wrong length (should be %d characters)")
# * <tt>message</tt> - The error message to use for a :minimum, :maximum, or :is violation. An alias of the appropriate too_long/too_short/wrong_length message
diff --git a/activerecord/test/validations_test.rb b/activerecord/test/validations_test.rb
index 2b913bda22..d7ba74597c 100755
--- a/activerecord/test/validations_test.rb
+++ b/activerecord/test/validations_test.rb
@@ -156,11 +156,11 @@ class ValidationsTest < Test::Unit::TestCase
def test_errors_on_boundary_breaking
developer = Developer.new("name" => "xs")
assert !developer.save
- assert_equal "is too short (min is 3 characters)", developer.errors.on("name")
+ assert_equal "is too short (minimum is 3 characters)", developer.errors.on("name")
developer.name = "All too very long for this boundary, it really is"
assert !developer.save
- assert_equal "is too long (max is 20 characters)", developer.errors.on("name")
+ assert_equal "is too long (maximum is 20 characters)", developer.errors.on("name")
developer.name = "Just right"
assert developer.save
@@ -402,17 +402,17 @@ class ValidationsTest < Test::Unit::TestCase
t.title = "not"
assert !t.valid?
assert t.errors.on(:title)
- assert_equal "is too short (min is 5 characters)", t.errors["title"]
+ assert_equal "is too short (minimum is 5 characters)", t.errors["title"]
t.title = ""
assert !t.valid?
assert t.errors.on(:title)
- assert_equal "is too short (min is 5 characters)", t.errors["title"]
+ assert_equal "is too short (minimum is 5 characters)", t.errors["title"]
t.title = nil
assert !t.valid?
assert t.errors.on(:title)
- assert_equal "is too short (min is 5 characters)", t.errors["title"]
+ assert_equal "is too short (minimum is 5 characters)", t.errors["title"]
end
def test_optionally_validates_length_of_using_minimum
@@ -434,7 +434,7 @@ class ValidationsTest < Test::Unit::TestCase
t.title = "notvalid"
assert !t.valid?
assert t.errors.on(:title)
- assert_equal "is too long (max is 5 characters)", t.errors["title"]
+ assert_equal "is too long (maximum is 5 characters)", t.errors["title"]
t.title = ""
assert t.valid?
@@ -458,14 +458,14 @@ class ValidationsTest < Test::Unit::TestCase
t = Topic.new("title" => "a!", "content" => "I'm ooooooooh so very long")
assert !t.valid?
- assert_equal "is too short (min is 3 characters)", t.errors.on(:title)
- assert_equal "is too long (max is 5 characters)", t.errors.on(:content)
+ assert_equal "is too short (minimum is 3 characters)", t.errors.on(:title)
+ assert_equal "is too long (maximum is 5 characters)", t.errors.on(:content)
t.title = nil
t.content = nil
assert !t.valid?
- assert_equal "is too short (min is 3 characters)", t.errors.on(:title)
- assert_equal "is too short (min is 3 characters)", t.errors.on(:content)
+ assert_equal "is too short (minimum is 3 characters)", t.errors.on(:title)
+ assert_equal "is too short (minimum is 3 characters)", t.errors.on(:content)
t.title = "abe"
t.content = "mad"
@@ -662,7 +662,7 @@ class ValidationsTest < Test::Unit::TestCase
t.title = "一二三四"
assert !t.valid?
assert t.errors.on(:title)
- assert_equal "is too short (min is 5 characters)", t.errors["title"]
+ assert_equal "is too short (minimum is 5 characters)", t.errors["title"]
end
end
@@ -676,7 +676,7 @@ class ValidationsTest < Test::Unit::TestCase
t.title = "一二34五六"
assert !t.valid?
assert t.errors.on(:title)
- assert_equal "is too long (max is 5 characters)", t.errors["title"]
+ assert_equal "is too long (maximum is 5 characters)", t.errors["title"]
end
end
@@ -686,8 +686,8 @@ class ValidationsTest < Test::Unit::TestCase
t = Topic.new("title" => "一二", "content" => "12三四五六七")
assert !t.valid?
- assert_equal "is too short (min is 3 characters)", t.errors.on(:title)
- assert_equal "is too long (max is 5 characters)", t.errors.on(:content)
+ assert_equal "is too short (minimum is 3 characters)", t.errors.on(:title)
+ assert_equal "is too long (maximum is 5 characters)", t.errors.on(:content)
t.title = "一二三"
t.content = "12三"
assert t.valid?
diff --git a/railties/lib/tasks/databases.rake b/railties/lib/tasks/databases.rake
index e4da9aff78..73bde972d1 100644
--- a/railties/lib/tasks/databases.rake
+++ b/railties/lib/tasks/databases.rake
@@ -6,7 +6,7 @@ namespace :db do
end
namespace :fixtures do
- desc "Load fixtures into the current environment's database. Load a single fixture using FIXTURE=x"
+ desc "Load fixtures into the current environment's database. Load specific fixtures using FIXTURES=x,y"
task :load => :environment do
require 'active_record/fixtures'
ActiveRecord::Base.establish_connection(RAILS_ENV.to_sym)