Sha256: f1d0d5de942f78ed5d75da3479980b0a2e46216e2b65644aee3e321b8b146253

Contents?: true

Size: 752 Bytes

Versions: 1

Compression:

Stored size: 752 Bytes

Contents

# @deprecated   This code is unused / no longer useful.  It will be removed no later than release 6.x
# This middleware is for use in development mode, when User
# is removed/reloaded each request. This makes sure modules
# stay loaded.
require 'deprecation'
class UserAttributesLoader
  extend Deprecation
  
  self.deprecation_horizon = 'hydra-head 5.x'

  def initialize(app)
    Deprecation.warn("UserAttributesLoader has been deprecated; it will be removed from HydraHead no later than release 6.")
    @app = app
  end

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

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
hydra-head-4.0.2 lib/user_attributes_loader.rb