Class: Decidim::Lausanne::Budgets::CurrentUserRecordMiddleware
- Inherits:
-
Object
- Object
- Decidim::Lausanne::Budgets::CurrentUserRecordMiddleware
- Defined in:
- lib/decidim/lausanne/budgets/current_user_record_middleware.rb
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(app) ⇒ CurrentUserRecordMiddleware
constructor
A new instance of CurrentUserRecordMiddleware.
Constructor Details
#initialize(app) ⇒ CurrentUserRecordMiddleware
Returns a new instance of CurrentUserRecordMiddleware.
5 6 7 |
# File 'lib/decidim/lausanne/budgets/current_user_record_middleware.rb', line 5 def initialize(app) @app = app end |
Instance Method Details
#call(env) ⇒ Object
9 10 11 12 13 |
# File 'lib/decidim/lausanne/budgets/current_user_record_middleware.rb', line 9 def call(env) request = ActionDispatch::Request.new(env) env["decidim_current_user_record"] = request..encrypted["decidim_current_user_record"].to_i || nil @app.call(env) end |