Class: Decidim::EnhancedTextwork::ApplicationController
- Inherits:
-
Components::BaseController
- Object
- Components::BaseController
- Decidim::EnhancedTextwork::ApplicationController
- Defined in:
- app/controllers/decidim/enhanced_textwork/application_controller.rb
Overview
This controller is the abstract class from which all other controllers of this engine inherit.
Note that it inherits from `Decidim::Components::BaseController`, which override its layout and provide all kinds of useful methods.
Direct Known Subclasses
CollaborativeDraftsController, ParagraphVotesController, ParagraphsController, VersionsController
Instance Method Summary collapse
Instance Method Details
#paragraph_limit ⇒ Object
14 15 16 17 18 |
# File 'app/controllers/decidim/enhanced_textwork/application_controller.rb', line 14 def paragraph_limit return nil if component_settings.paragraph_limit.zero? component_settings.paragraph_limit end |
#paragraph_limit_reached? ⇒ Boolean
20 21 22 23 24 |
# File 'app/controllers/decidim/enhanced_textwork/application_controller.rb', line 20 def paragraph_limit_reached? return false unless paragraph_limit paragraphs.where(author: current_user).count >= paragraph_limit end |
#paragraphs ⇒ Object
26 27 28 |
# File 'app/controllers/decidim/enhanced_textwork/application_controller.rb', line 26 def paragraphs Paragraph.where(component: current_component) end |