Sha256: cda8a0ac0434179f3b44b0e7b0abb8762e17d303685a14c38792b2cc45c809f8
Contents?: true
Size: 477 Bytes
Versions: 85
Compression:
Stored size: 477 Bytes
Contents
# frozen_string_literal: true module Decidim module Comments # A form object used to create comments from the graphql api. # class CommentForm < Form attribute :body, String attribute :alignment, Integer attribute :user_group_id, Integer mimic :comment validates :body, presence: true, length: { maximum: 1000 } validates :alignment, inclusion: { in: [0, 1, -1] }, if: ->(form) { form.alignment.present? } end end end
Version data entries
85 entries across 85 versions & 2 rubygems