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

Merge pull request #21283 from ravindrakumawat/add_docs_for_pending_migration

Add Docs for ActiveRecord #check_pending [ci skip]
This commit is contained in:
Yves Senn 2015-08-18 08:50:22 +02:00
commit 2a2473fd71

View file

@ -376,6 +376,7 @@ module ActiveRecord
attr_accessor :delegate # :nodoc: attr_accessor :delegate # :nodoc:
attr_accessor :disable_ddl_transaction # :nodoc: attr_accessor :disable_ddl_transaction # :nodoc:
# Raises <tt>ActiveRecord::PendingMigrationError</tt> error if any migrations are pending.
def check_pending!(connection = Base.connection) def check_pending!(connection = Base.connection)
raise ActiveRecord::PendingMigrationError if ActiveRecord::Migrator.needs_migration?(connection) raise ActiveRecord::PendingMigrationError if ActiveRecord::Migrator.needs_migration?(connection)
end end