diff options
author | Sam Pohlenz <sam@sampohlenz.com> | 2011-07-03 13:02:58 +0930 |
---|---|---|
committer | Sam Pohlenz <sam@sampohlenz.com> | 2011-07-03 13:02:58 +0930 |
commit | a7a58af244412f507048d3e2118eeca4992b705e (patch) | |
tree | a312359301b90de8917106bde44ec615e33d8bc5 /railties | |
parent | 9d6e5e64dcd129132c3c565d0b6ead8c9bf45c2f (diff) | |
download | rails-a7a58af244412f507048d3e2118eeca4992b705e.tar.gz rails-a7a58af244412f507048d3e2118eeca4992b705e.tar.bz2 rails-a7a58af244412f507048d3e2118eeca4992b705e.zip |
Fix has_migrations? check in Rails::Engine
Diffstat (limited to 'railties')
-rw-r--r-- | railties/lib/rails/engine.rb | 2 | ||||
-rw-r--r-- | railties/test/railties/shared_tests.rb | 9 |
2 files changed, 10 insertions, 1 deletions
diff --git a/railties/lib/rails/engine.rb b/railties/lib/rails/engine.rb index bf57a034b2..eb6fcd5dd7 100644 --- a/railties/lib/rails/engine.rb +++ b/railties/lib/rails/engine.rb @@ -586,7 +586,7 @@ module Rails end def has_migrations? - paths["db/migrate"].first.present? + paths["db/migrate"].existent.any? end def find_root_with_flag(flag, default=nil) diff --git a/railties/test/railties/shared_tests.rb b/railties/test/railties/shared_tests.rb index 8cbc76db71..9a64b7c64e 100644 --- a/railties/test/railties/shared_tests.rb +++ b/railties/test/railties/shared_tests.rb @@ -84,6 +84,15 @@ module RailtiesTest end end + def test_no_rake_task_without_migrations + boot_rails + require 'rake' + require 'rdoc/task' + require 'rake/testtask' + Rails.application.load_tasks + assert !Rake::Task.task_defined?('bukkits:install:migrations') + end + def test_puts_its_lib_directory_on_load_path boot_rails require "another" |