Sha256: 8d635ee1bb852dd8d36293ba5a914ce916ba363816221edddcd6b8ab60dc240b

Contents?: true

Size: 495 Bytes

Versions: 42

Compression:

Stored size: 495 Bytes

Contents

module ActiveGraph
  module Migrations
    class CheckPending
      def initialize(app)
        @app = app
        @last_check = 0
      end

      def call(env)
        latest_migration = ActiveGraph::Migrations::Runner.latest_migration
        mtime = latest_migration ? latest_migration.version.to_i : 0
        if @last_check < mtime
          ActiveGraph::Migrations.check_for_pending_migrations!
          @last_check = mtime
        end
        @app.call(env)
      end
    end
  end
end

Version data entries

42 entries across 42 versions & 1 rubygems

Version Path
activegraph-10.1.1 lib/active_graph/migrations/check_pending.rb
activegraph-11.0.1-java lib/active_graph/migrations/check_pending.rb
activegraph-11.0.0-java lib/active_graph/migrations/check_pending.rb
activegraph-10.1.0 lib/active_graph/migrations/check_pending.rb
activegraph-11.0.0.beta.4-java lib/active_graph/migrations/check_pending.rb
activegraph-10.0.2 lib/active_graph/migrations/check_pending.rb
activegraph-11.0.0.beta.3-java lib/active_graph/migrations/check_pending.rb
activegraph-11.0.0.beta.2-java lib/active_graph/migrations/check_pending.rb
activegraph-11.0.0.beta.1-java lib/active_graph/migrations/check_pending.rb
activegraph-10.0.1 lib/active_graph/migrations/check_pending.rb
activegraph-10.0.0 lib/active_graph/migrations/check_pending.rb
activegraph-10.0.0.pre.beta.11 lib/active_graph/migrations/check_pending.rb
activegraph-10.0.0.pre.beta.10 lib/active_graph/migrations/check_pending.rb
activegraph-10.0.0.pre.beta.9 lib/active_graph/migrations/check_pending.rb
activegraph-10.0.0.pre.beta.8 lib/active_graph/migrations/check_pending.rb
activegraph-10.0.0.pre.beta.7 lib/active_graph/migrations/check_pending.rb
activegraph-10.0.0.pre.beta.6 lib/active_graph/migrations/check_pending.rb
activegraph-10.0.0.pre.beta.5 lib/active_graph/migrations/check_pending.rb
activegraph-10.0.0.pre.beta.4 lib/active_graph/migrations/check_pending.rb
activegraph-10.0.0.pre.beta.3 lib/active_graph/migrations/check_pending.rb