Sha256: 0b4adc228caaf17abdef6b44b715f0bfddaa73f997b509f67cd5815c88445bf7

Contents?: true

Size: 684 Bytes

Versions: 18

Compression:

Stored size: 684 Bytes

Contents

module Apartment

  class Reloader

    #   Middleware used in development to init Apartment for each request
    #   Necessary due to code reload (annoying).  When models are reloaded, they no longer have the proper table_name
    #   That is prepended with the schema (if using postgresql schemas)
    #   I couldn't figure out how to properly hook into the Rails reload process *after* files are reloaded
    #   so I've used this in the meantime.
    #
    #   Also see apartment/console for the re-definition of reload! that re-init's Apartment
    #
    def initialize(app)
      @app = app
    end

    def call(env)
      Database.init
      @app.call(env)
    end

  end

end

Version data entries

18 entries across 18 versions & 2 rubygems

Version Path
apartment-0.22.1 lib/apartment/reloader.rb
apartment-0.22.0 lib/apartment/reloader.rb
apartment-0.21.1 lib/apartment/reloader.rb
apartment-0.21.0 lib/apartment/reloader.rb
dr-apartment-0.14.1 lib/apartment/reloader.rb
apartment-0.20.0 lib/apartment/reloader.rb
apartment-0.19.0 lib/apartment/reloader.rb
apartment-0.18.0 lib/apartment/reloader.rb
apartment-0.17.3 lib/apartment/reloader.rb
apartment-0.17.2 lib/apartment/reloader.rb
apartment-0.17.1 lib/apartment/reloader.rb
apartment-0.17.0 lib/apartment/reloader.rb
apartment-0.16.0 lib/apartment/reloader.rb
apartment-0.15.0 lib/apartment/reloader.rb
apartment-0.14.4 lib/apartment/reloader.rb
apartment-0.14.3 lib/apartment/reloader.rb
apartment-0.14.2 lib/apartment/reloader.rb
apartment-0.14.1 lib/apartment/reloader.rb