diff options
author | Piotr Sarnacki <drogus@gmail.com> | 2010-11-21 02:20:09 +0100 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2010-11-22 13:43:12 +0100 |
commit | f821055dc7bead5ab348f63279cd4321d4d9c3c8 (patch) | |
tree | 19061911f358091c8a876c8c001ff8642729058d /railties/test | |
parent | 799a6fa047aa44ab4813dbf9328941b6d620e9b6 (diff) | |
download | rails-f821055dc7bead5ab348f63279cd4321d4d9c3c8.tar.gz rails-f821055dc7bead5ab348f63279cd4321d4d9c3c8.tar.bz2 rails-f821055dc7bead5ab348f63279cd4321d4d9c3c8.zip |
Do not create table_name_prefix method on isolated module if the method already exists.
Signed-off-by: José Valim <jose.valim@gmail.com>
Diffstat (limited to 'railties/test')
-rw-r--r-- | railties/test/railties/engine_test.rb | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/railties/test/railties/engine_test.rb b/railties/test/railties/engine_test.rb index 701b6816c8..7548c6318e 100644 --- a/railties/test/railties/engine_test.rb +++ b/railties/test/railties/engine_test.rb @@ -683,5 +683,24 @@ module RailtiesTest app_generators = Rails.application.config.generators.options[:rails] assert_equal :test_unit , app_generators[:test_framework] end + + test "do not create table_name_prefix method if it already exists" do + @plugin.write "lib/bukkits.rb", <<-RUBY + module Bukkits + def self.table_name_prefix + "foo" + end + + class Engine < ::Rails::Engine + isolate_namespace(Bukkits) + end + end + RUBY + + boot_rails + require "#{rails_root}/config/environment" + + assert_equal "foo", Bukkits.table_name_prefix + end end end |