Skip to content
Browse files

fix I18n.translate key for edge rails [#80]

  • Loading branch information...
1 parent a692f6d commit 8a111a6e815fc2a94567d709667a13850b98b5ab @cristibalan cristibalan committed with rmm5t Sep 18, 2008
Showing with 12 additions and 12 deletions.
  1. +12 −12 lib/shoulda/active_record/macros.rb
View
24 lib/shoulda/active_record/macros.rb
@@ -3,7 +3,7 @@ module Shoulda # :nodoc:
module ActiveRecord # :nodoc:
DEFAULT_ERROR_MESSAGES =
if Object.const_defined?(:I18n)
- I18n.translate('active_record.error_messages')
+ I18n.translate('activerecord.errors.messages')
else
::ActiveRecord::Errors.default_error_messages
end
@@ -43,7 +43,7 @@ def load_all_fixtures
#
# Options:
# * <tt>:message</tt> - value the test expects to find in <tt>errors.on(:attribute)</tt>.
- # Regexp or string. Default = <tt>I18n.translate('active_record.error_messages')[:blank]</tt>
+ # Regexp or string. Default = <tt>I18n.translate('activerecord.errors.messages')[:blank]</tt>
#
# Example:
# should_require_attributes :name, :phone_number
@@ -65,7 +65,7 @@ def should_require_attributes(*attributes)
#
# Options:
# * <tt>:message</tt> - value the test expects to find in <tt>errors.on(:attribute)</tt>.
- # Regexp or string. Default = <tt>I18n.translate('active_record.error_messages')[:taken]</tt>
+ # Regexp or string. Default = <tt>I18n.translate('activerecord.errors.messages')[:taken]</tt>
# * <tt>:scoped_to</tt> - field(s) to scope the uniqueness to.
#
# Examples:
@@ -163,7 +163,7 @@ def should_have_readonly_attributes(*attributes)
#
# Options:
# * <tt>:message</tt> - value the test expects to find in <tt>errors.on(:attribute)</tt>.
- # Regexp or string. Default = <tt>I18n.translate('active_record.error_messages')[:invalid]</tt>
+ # Regexp or string. Default = <tt>I18n.translate('activerecord.errors.messages')[:invalid]</tt>
#
# Example:
# should_not_allow_values_for :isbn, "bad 1", "bad 2"
@@ -206,9 +206,9 @@ def should_allow_values_for(attribute, *good_values)
#
# Options:
# * <tt>:short_message</tt> - value the test expects to find in <tt>errors.on(:attribute)</tt>.
- # Regexp or string. Default = <tt>I18n.translate('active_record.error_messages')[:too_short] % range.first</tt>
+ # Regexp or string. Default = <tt>I18n.translate('activerecord.errors.messages')[:too_short] % range.first</tt>
# * <tt>:long_message</tt> - value the test expects to find in <tt>errors.on(:attribute)</tt>.
- # Regexp or string. Default = <tt>I18n.translate('active_record.error_messages')[:too_long] % range.last</tt>
+ # Regexp or string. Default = <tt>I18n.translate('activerecord.errors.messages')[:too_long] % range.last</tt>
#
# Example:
# should_ensure_length_in_range :password, (6..20)
@@ -258,7 +258,7 @@ def should_ensure_length_in_range(attribute, range, opts = {})
#
# Options:
# * <tt>:short_message</tt> - value the test expects to find in <tt>errors.on(:attribute)</tt>.
- # Regexp or string. Default = <tt>I18n.translate('active_record.error_messages')[:too_short] % min_length</tt>
+ # Regexp or string. Default = <tt>I18n.translate('activerecord.errors.messages')[:too_short] % min_length</tt>
#
# Example:
# should_ensure_length_at_least :name, 3
@@ -289,7 +289,7 @@ def should_ensure_length_at_least(attribute, min_length, opts = {})
#
# Options:
# * <tt>:message</tt> - value the test expects to find in <tt>errors.on(:attribute)</tt>.
- # Regexp or string. Default = <tt>I18n.translate('active_record.error_messages')[:wrong_length] % length</tt>
+ # Regexp or string. Default = <tt>I18n.translate('activerecord.errors.messages')[:wrong_length] % length</tt>
#
# Example:
# should_ensure_length_is :ssn, 9
@@ -324,9 +324,9 @@ def should_ensure_length_is(attribute, length, opts = {})
#
# Options:
# * <tt>:low_message</tt> - value the test expects to find in <tt>errors.on(:attribute)</tt>.
- # Regexp or string. Default = <tt>I18n.translate('active_record.error_messages')[:inclusion]</tt>
+ # Regexp or string. Default = <tt>I18n.translate('activerecord.errors.messages')[:inclusion]</tt>
# * <tt>:high_message</tt> - value the test expects to find in <tt>errors.on(:attribute)</tt>.
- # Regexp or string. Default = <tt>I18n.translate('active_record.error_messages')[:inclusion]</tt>
+ # Regexp or string. Default = <tt>I18n.translate('activerecord.errors.messages')[:inclusion]</tt>
#
# Example:
# should_ensure_value_in_range :age, (0..100)
@@ -369,7 +369,7 @@ def should_ensure_value_in_range(attribute, range, opts = {})
#
# Options:
# * <tt>:message</tt> - value the test expects to find in <tt>errors.on(:attribute)</tt>.
- # Regexp or string. Default = <tt>I18n.translate('active_record.error_messages')[:not_a_number]</tt>
+ # Regexp or string. Default = <tt>I18n.translate('activerecord.errors.messages')[:not_a_number]</tt>
#
# Example:
# should_only_allow_numeric_values_for :age
@@ -623,7 +623,7 @@ def should_have_indices(*columns)
#
# Options:
# * <tt>:message</tt> - value the test expects to find in <tt>errors.on(:attribute)</tt>.
- # Regexp or string. Default = <tt>I18n.translate('active_record.error_messages')[:accepted]</tt>
+ # Regexp or string. Default = <tt>I18n.translate('activerecord.errors.messages')[:accepted]</tt>
#
# Example:
# should_require_acceptance_of :eula

0 comments on commit 8a111a6

Please sign in to comment.
Something went wrong with that request. Please try again.