Class: Decidim::Comments::CommentForm
- Inherits:
-
Form
- Object
- Form
- Decidim::Comments::CommentForm
- Includes:
- UserRoleChecker
- Defined in:
- app/forms/decidim/comments/comment_form.rb
Overview
A form object used to create comments from the graphql api.
Instance Method Summary collapse
Instance Method Details
#max_depth ⇒ Object
33 34 35 36 37 |
# File 'app/forms/decidim/comments/comment_form.rb', line 33 def max_depth return unless commentable.respond_to?(:depth) errors.add(:base, :invalid) if commentable.depth >= Comment::MAX_DEPTH end |
#max_length ⇒ Object
23 24 25 26 27 28 29 30 31 |
# File 'app/forms/decidim/comments/comment_form.rb', line 23 def max_length if current_component.try(:settings).respond_to?(:comments_max_length) component_length = current_component.try { settings.comments_max_length.positive? } return current_component.settings.comments_max_length if component_length end return current_organization.comments_max_length if current_organization.comments_max_length.positive? 1000 end |