From 0831b7e076af1ecae41a55dd82cb0582b96518a0 Mon Sep 17 00:00:00 2001 From: thoefer Date: Wed, 8 Jun 2011 13:40:17 +0200 Subject: Brought back alternative convention for namespaced models in i18n. --- activemodel/test/cases/translation_test.rb | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'activemodel/test/cases') diff --git a/activemodel/test/cases/translation_test.rb b/activemodel/test/cases/translation_test.rb index 1b1d972d5c..838956bc98 100644 --- a/activemodel/test/cases/translation_test.rb +++ b/activemodel/test/cases/translation_test.rb @@ -76,5 +76,15 @@ class ActiveModelI18nTests < ActiveModel::TestCase Person.model_name.human(options) assert_equal({:default => 'person model'}, options) end + + def test_alternate_namespaced_model_attribute_translation + I18n.backend.store_translations 'en', :activemodel => {:attributes => {:person => {:gender => {:attribute => 'person gender attribute'}}}} + assert_equal 'person gender attribute', Person::Gender.human_attribute_name('attribute') + end + + def test_alternate_namespaced_model_translation + I18n.backend.store_translations 'en', :activemodel => {:models => {:person => {:gender => 'person gender model'}}} + assert_equal 'person gender model', Person::Gender.model_name.human + end end -- cgit v1.2.3