aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/i18n_interpolation_deprecation.rb
diff options
context:
space:
mode:
authorJoshua Peek <josh@joshpeek.com>2009-05-29 16:06:21 -0500
committerJoshua Peek <josh@joshpeek.com>2009-05-29 16:06:21 -0500
commit69742ca8fa05509f7d7c5512cb6d8e002ecb3ab3 (patch)
tree044c2131cc87d21ee54027511aae2b7f2d2ae26a /activerecord/lib/active_record/i18n_interpolation_deprecation.rb
parent5f3f100ce2d689480da85abc88e5e940cf90189e (diff)
parent5ec2c7dc29b36d85b2658465b8a979deb0529d7e (diff)
downloadrails-69742ca8fa05509f7d7c5512cb6d8e002ecb3ab3.tar.gz
rails-69742ca8fa05509f7d7c5512cb6d8e002ecb3ab3.tar.bz2
rails-69742ca8fa05509f7d7c5512cb6d8e002ecb3ab3.zip
Merge branch 'master' into active_model
Conflicts: activemodel/lib/active_model/core.rb activemodel/test/cases/state_machine/event_test.rb activemodel/test/cases/state_machine/state_transition_test.rb activerecord/lib/active_record/validations.rb activerecord/test/cases/validations/i18n_validation_test.rb activeresource/lib/active_resource.rb activeresource/test/abstract_unit.rb
Diffstat (limited to 'activerecord/lib/active_record/i18n_interpolation_deprecation.rb')
-rw-r--r--activerecord/lib/active_record/i18n_interpolation_deprecation.rb26
1 files changed, 0 insertions, 26 deletions
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