Sha256: 7d30c580fbb67d0020574681ab1a015a33b1b51d1a91d67fc3126d43784a2a49
Contents?: true
Size: 476 Bytes
Versions: 11
Compression:
Stored size: 476 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
11 entries across 11 versions & 2 rubygems