Sha256: e88147b290e9145878179db013f8cfbd16883704ffa211c40bec4887598e5b0d
Contents?: true
Size: 703 Bytes
Versions: 44
Compression:
Stored size: 703 Bytes
Contents
module Workarea class Inquiry include ApplicationDocument field :name, type: String field :email, type: String field :order_id, type: String field :subject, type: String field :message, type: String validates :subject, length: { maximum: 1_000 } validates :message, presence: true, length: { maximum: 2_000 } validate :subject_exists def full_subject Workarea.config.inquiry_subjects[subject] end private def subject_exists unless subject.blank? || Workarea.config.inquiry_subjects.keys.include?(subject) errors.add(:subject, I18n.t('errors.messages.inclusion')) end end end end
Version data entries
44 entries across 44 versions & 1 rubygems