Skip to content
Browse files

Merge pull request #1945 from spohlenz/fix-engine-migrations-check

Fix has_migrations? check in Rails::Engine
  • Loading branch information...
2 parents 3875e44 + a7a58af commit a1d85a03bd0541faafff43973698df4a9e4973f2 @josevalim josevalim committed Jul 2, 2011
Showing with 10 additions and 1 deletion.
  1. +1 −1 railties/lib/rails/engine.rb
  2. +9 −0 railties/test/railties/shared_tests.rb
View
2 railties/lib/rails/engine.rb
@@ -586,7 +586,7 @@ def routes?
end
def has_migrations?
- paths["db/migrate"].first.present?
+ paths["db/migrate"].existent.any?
end
def find_root_with_flag(flag, default=nil)
View
9 railties/test/railties/shared_tests.rb
@@ -84,6 +84,15 @@ class CreateYaffles < ActiveRecord::Migration
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"

0 comments on commit a1d85a0

Please sign in to comment.
Something went wrong with that request. Please try again.