Sha256: f53768233f9265c2ea4891f95003b2e1d81710a107cc943c76d06e7edb65b73d

Contents?: true

Size: 664 Bytes

Versions: 4

Compression:

Stored size: 664 Bytes

Contents

module Refinery
  module Contacts
    class MailMessage < TableLessModel
      attr_accessor :name, :recipient_id, :subject, :text, :sender_mail, :code, :recipient_mail

      validates :name,         :presence => true
      validates :recipient_id, :presence => true
      validates_numericality_of :recipient_id, :if => Proc.new { |mail_message| mail_message.recipient_id.present? } # dont show recipient is not number, when that mail adress is not selected yet.

      validates :subject,   :presence => true
      validates :text,      :presence => true
      validates_format_of   :sender_mail, :with => /.+@.+\..+/i , :allow_blank => false
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
refinerycms-contacts-0.2.0 app/models/refinery/contacts/mail_message.rb
refinerycms-contacts-0.1.2 app/models/refinery/contacts/mail_message.rb
refinerycms-contacts-0.1.1 app/models/refinery/contacts/mail_message.rb
refinerycms-contacts-0.1.0 app/models/refinery/contacts/mail_message.rb