如果將 config.active_record.migration_error
設為 :page_load
,將使用這個類別來驗證在載入網頁之前是否已執行所有遷移。
方法
類別公開的方法
new(app, file_watcher: ActiveSupport::FileUpdateChecker) 連結
實例公開的方法
call(env) 連結
# File activerecord/lib/active_record/migration.rb, line 656 def call(env) @mutex.synchronize do @watcher ||= build_watcher do @needs_check = true ActiveRecord::Migration.check_pending_migrations @needs_check = false end if @needs_check @watcher.execute else @watcher.execute_if_updated end end @app.call(env) end