class ActiveGraph::Migrations::CheckPending
Public Class Methods
new(app)
click to toggle source
# File lib/active_graph/migrations/check_pending.rb 4 def initialize(app) 5 @app = app 6 @last_check = 0 7 end
Public Instance Methods
call(env)
click to toggle source
# File lib/active_graph/migrations/check_pending.rb 9 def call(env) 10 latest_migration = ActiveGraph::Migrations::Runner.latest_migration 11 mtime = latest_migration ? latest_migration.version.to_i : 0 12 if @last_check < mtime 13 ActiveGraph::Migrations.check_for_pending_migrations! 14 @last_check = mtime 15 end 16 @app.call(env) 17 end