diff options
author | Nicholas Seckar <nseckar@gmail.com> | 2006-04-06 16:06:38 +0000 |
---|---|---|
committer | Nicholas Seckar <nseckar@gmail.com> | 2006-04-06 16:06:38 +0000 |
commit | 64003677b7063aabc2a943e75e56b48cae6b15f7 (patch) | |
tree | 00bd7f2a6ab6ddf96f4a8026d41a20573431a094 /activerecord/test | |
parent | 9935a3561e0bc9f356b8c0213cec65fc853fd7d6 (diff) | |
download | rails-64003677b7063aabc2a943e75e56b48cae6b15f7.tar.gz rails-64003677b7063aabc2a943e75e56b48cae6b15f7.tar.bz2 rails-64003677b7063aabc2a943e75e56b48cae6b15f7.zip |
Fix type_name_with_module to handle type names that begin with '::'. Closes #4614.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4187 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activerecord/test')
-rwxr-xr-x | activerecord/test/base_test.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/activerecord/test/base_test.rb b/activerecord/test/base_test.rb index 69665098af..391ee57632 100755 --- a/activerecord/test/base_test.rb +++ b/activerecord/test/base_test.rb @@ -1257,6 +1257,11 @@ class BasicsTest < Test::Unit::TestCase assert_equal(%w( title ), topics(:first).attributes(:only => :title).keys) assert_equal(%w( title author_name type id approved ), topics(:first).attributes(:only => [ :title, :id, :type, :approved, :author_name ]).keys) end + + def test_type_name_with_module_should_handle_beginning + assert_equal 'ActiveRecord::Person', ActiveRecord::Base.send(:type_name_with_module, 'Person') + assert_equal '::Person', ActiveRecord::Base.send(:type_name_with_module, '::Person') + end # FIXME: this test ought to run, but it needs to run sandboxed so that it # doesn't b0rk the current test environment by undefing everything. |