Sha256: 4fdfb9bced1d44b98afb6e23c292e75d1d317db7b860d20f58632caad459654e

Contents?: true

Size: 785 Bytes

Versions: 4

Compression:

Stored size: 785 Bytes

Contents

# Rake task to warn over the shell when there are pending migrations.
# origin: RM
namespace :db do

  desc "Warns if there are pending migrations"
  task :warn_if_pending_migrations => :environment do
    if defined? ActiveRecord
      pending_migrations = ActiveRecord::Migrator.new(:up, 'db/migrate').pending_migrations

      if pending_migrations.any?
        puts ""
        puts "======================================================="
        puts "You have #{pending_migrations.size} pending migrations:"
        pending_migrations.each do |pending_migration|
          puts '  %4d %s' % [pending_migration.version, pending_migration.name]
        end
        puts "======================================================="
        puts ""
      end
      
    end
  end

end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
serum-rails-0.2.1 spec/test_apps/rails-2-3/lib/tasks/pending_migrations.rake
serum-rails-0.2.0 spec/test_apps/rails-2-3/lib/tasks/pending_migrations.rake
serum-rails-0.1.1 spec/test_app/lib/tasks/pending_migrations.rake
serum-rails-0.1.0 spec/test_app/lib/tasks/pending_migrations.rake