diff options
author | José Valim <jose.valim@gmail.com> | 2011-07-02 20:42:08 -0700 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2011-07-02 20:42:08 -0700 |
commit | a1d85a03bd0541faafff43973698df4a9e4973f2 (patch) | |
tree | fae02c65829e8efce4dd9894ce6c71838f903bfa | |
parent | 3875e449abb8b999beca9179a34c6d18fe54feb9 (diff) | |
parent | a7a58af244412f507048d3e2118eeca4992b705e (diff) | |
download | rails-a1d85a03bd0541faafff43973698df4a9e4973f2.tar.gz rails-a1d85a03bd0541faafff43973698df4a9e4973f2.tar.bz2 rails-a1d85a03bd0541faafff43973698df4a9e4973f2.zip |
Merge pull request #1945 from spohlenz/fix-engine-migrations-check
Fix has_migrations? check in Rails::Engine
-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" |