aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib
diff options
context:
space:
mode:
authorJeremy Kemper <jeremy@bitsweat.net>2009-05-12 17:58:37 -0700
committerJeremy Kemper <jeremy@bitsweat.net>2009-05-13 11:43:03 -0700
commita7ccc7c79fa69cea3b7d19bcaa4df3c2932238d8 (patch)
tree6c438a9d0a89e22c6fcd5a22ebfc6fe74149c4bb /activerecord/lib
parente9c5750bd1bb15b2d551ee014f06bd5019f2357d (diff)
downloadrails-a7ccc7c79fa69cea3b7d19bcaa4df3c2932238d8.tar.gz
rails-a7ccc7c79fa69cea3b7d19bcaa4df3c2932238d8.tar.bz2
rails-a7ccc7c79fa69cea3b7d19bcaa4df3c2932238d8.zip
Remove support for deprecated validation message interpolation format
Diffstat (limited to 'activerecord/lib')
-rw-r--r--activerecord/lib/active_record.rb1
-rw-r--r--activerecord/lib/active_record/i18n_interpolation_deprecation.rb26
2 files changed, 0 insertions, 27 deletions
diff --git a/activerecord/lib/active_record.rb b/activerecord/lib/active_record.rb
index 06d6c87090..c9e9a84ce7 100644
--- a/activerecord/lib/active_record.rb
+++ b/activerecord/lib/active_record.rb
@@ -75,5 +75,4 @@ module ActiveRecord
end
end
-require 'active_record/i18n_interpolation_deprecation'
I18n.load_path << File.dirname(__FILE__) + '/active_record/locale/en.yml'
diff --git a/activerecord/lib/active_record/i18n_interpolation_deprecation.rb b/activerecord/lib/active_record/i18n_interpolation_deprecation.rb
deleted file mode 100644
index cd634e1b8d..0000000000
--- a/activerecord/lib/active_record/i18n_interpolation_deprecation.rb
+++ /dev/null
@@ -1,26 +0,0 @@
-# Deprecates the use of the former message interpolation syntax in activerecord
-# as in "must have %d characters". The new syntax uses explicit variable names
-# as in "{{value}} must have {{count}} characters".
-
-require 'i18n/backend/simple'
-module I18n
- module Backend
- class Simple
- DEPRECATED_INTERPOLATORS = { '%d' => '{{count}}', '%s' => '{{value}}' }
-
- protected
- def interpolate_with_deprecated_syntax(locale, string, values = {})
- return string unless string.is_a?(String)
-
- string = string.gsub(/%d|%s/) do |s|
- instead = DEPRECATED_INTERPOLATORS[s]
- ActiveSupport::Deprecation.warn "using #{s} in messages is deprecated; use #{instead} instead."
- instead
- end
-
- interpolate_without_deprecated_syntax(locale, string, values)
- end
- alias_method_chain :interpolate, :deprecated_syntax
- end
- end
-end \ No newline at end of file