Sha256: dd8ef82063121edd372041c897855d7d3edd28aadaa86b1439b55f88d41f800d

Contents?: true

Size: 431 Bytes

Versions: 31

Compression:

Stored size: 431 Bytes

Contents

  # This middleware is for use in development mode, when User
  # is removed/reloaded each request. This makes sure modules
  # stay loaded.
  class UserAttributesLoader
    def initialize(app)
      @app = app
    end

    def call(env)
      User.class_eval do
        unless ancestors.include?(Hydra::GenericUserAttributes)
          include Hydra::GenericUserAttributes
        end
      end
      @app.call(env)
    end
  end

Version data entries

31 entries across 31 versions & 1 rubygems

Version Path
hydra-head-4.0.0 lib/user_attributes_loader.rb
hydra-head-4.0.0.rc6 lib/user_attributes_loader.rb
hydra-head-4.0.0.rc5 lib/user_attributes_loader.rb
hydra-head-4.0.0.rc4 lib/user_attributes_loader.rb
hydra-head-4.0.0.rc3 lib/user_attributes_loader.rb
hydra-head-4.0.0.rc2 lib/user_attributes_loader.rb
hydra-head-3.3.0 lib/user_attributes_loader.rb
hydra-head-3.2.2 lib/user_attributes_loader.rb
hydra-head-3.2.1 lib/user_attributes_loader.rb
hydra-head-3.2.0 lib/user_attributes_loader.rb
hydra-head-3.2.0.pre3 lib/user_attributes_loader.rb
hydra-head-3.2.0.pre2 lib/user_attributes_loader.rb
hydra-head-3.2.0.pre1 lib/user_attributes_loader.rb
hydra-head-3.1.5 lib/user_attributes_loader.rb
hydra-head-3.1.4 lib/user_attributes_loader.rb
hydra-head-3.1.3 lib/user_attributes_loader.rb
hydra-head-3.1.2 lib/user_attributes_loader.rb
hydra-head-3.1.1 lib/user_attributes_loader.rb
hydra-head-3.1.0 lib/user_attributes_loader.rb
hydra-head-3.1.0.rc2 lib/user_attributes_loader.rb