Sha256: 51ca52a7a97ee0a3987a3d993349c3a814d09decfec18983e8d0f6b4e3f073f6
Contents?: true
Size: 677 Bytes
Versions: 47
Compression:
Stored size: 677 Bytes
Contents
module RocketCMS module Models module ContactMessage extend ActiveSupport::Concern include RocketCMS::Model include RocketCMS.orm_specific('ContactMessage') included do apply_simple_captcha validates_email_format_of :email, unless: 'email.blank?' if RocketCMS.configuration.contacts_message_required validates_presence_of :content end validate do if email.blank? && phone.blank? errors.add(:email, I18n.t('rs.no_contact_info')) end end after_create do ContactMailer.new_message_email(self).deliver end end end end end
Version data entries
47 entries across 47 versions & 1 rubygems