Class: UserAttributesLoader
- Inherits:
-
Object
- Object
- UserAttributesLoader
- Defined in:
- lib/user_attributes_loader.rb
Overview
This middleware is for use in development mode, when User is removed/reloaded each request. This makes sure modules stay loaded.
Instance Method Summary (collapse)
- - (Object) call(env)
-
- (UserAttributesLoader) initialize(app)
constructor
A new instance of UserAttributesLoader.
Constructor Details
- (UserAttributesLoader) initialize(app)
A new instance of UserAttributesLoader
5 6 7 |
# File 'lib/user_attributes_loader.rb', line 5 def initialize(app) @app = app end |
Instance Method Details
- (Object) call(env)
9 10 11 12 13 14 15 16 |
# File 'lib/user_attributes_loader.rb', line 9 def call(env) User.class_eval do unless ancestors.include?(Hydra::GenericUserAttributes) include Hydra::GenericUserAttributes end end @app.call(env) end |