Class: Decidim::Conferences::CurrentConference
- Inherits:
-
Object
- Object
- Decidim::Conferences::CurrentConference
- Defined in:
- app/constraints/decidim/conferences/current_conference.rb
Overview
This class infers the current conference we are scoped to by looking at the request parameters and the organization in the request environment, and injects it into the environment.
Instance Method Summary collapse
-
#matches?(request) ⇒ Boolean
Public: Matches the request against a conference and injects it into the environment.
Instance Method Details
#matches?(request) ⇒ Boolean
Public: Matches the request against a conference and injects it
into the environment.
request - The request that holds the conference relevant
information.
Returns a true if the request matched, false otherwise
16 17 18 19 20 21 22 23 |
# File 'app/constraints/decidim/conferences/current_conference.rb', line 16 def matches?(request) env = request.env @organization = env["decidim.current_organization"] return false unless @organization current_conference(env, request.params) ? true : false end |