1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

rake db:seed should check if the database have pending migrations [#5163 state:resolved]

Signed-off-by: José Valim <jose.valim@gmail.com>
This commit is contained in:
Thiago Pradi 2010-07-20 14:59:10 -03:00 committed by José Valim
parent f3e42292a5
commit c96a505391

View file

@ -274,7 +274,7 @@ namespace :db do
task :setup => [ 'db:create', 'db:schema:load', 'db:seed' ]
desc 'Load the seed data from db/seeds.rb'
task :seed => :environment do
task :seed => 'db:abort_if_pending_migrations' do
seed_file = File.join(Rails.root, 'db', 'seeds.rb')
load(seed_file) if File.exist?(seed_file)
end