Class: Constraints::JournalCategories
- Inherits:
-
Object
- Object
- Constraints::JournalCategories
- Defined in:
- lib/constraints/categories.rb
Class Method Summary collapse
Class Method Details
.matches?(request) ⇒ Boolean
3 4 5 6 7 8 9 10 11 12 13 |
# File 'lib/constraints/categories.rb', line 3 def self.matches?(request) begin if request.path.end_with? "/preview" JournalCategory.find(request.params[:slug]) else JournalCategory.not_hidden.find(request.params[:slug]) end rescue false end end |