Sha256: 04e8d50864ef7180dda7756ccf088d5b8baf692097f997bd7c43c68f562bdd9c
Contents?: true
Size: 424 Bytes
Versions: 5
Compression:
Stored size: 424 Bytes
Contents
class Email < ApplicationRecord validates :from_name, :to_name, :subject, :plain_content, :html_content, presence: true validates :from_email, :to_email, format: { with: /\A([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})\Z/i } scope :sent, -> { where('sent_at IS NOT NULL') } scope :not_sent, -> { where('sent_at IS NULL') } def mark_as_sent! update_attribute :sent_at, DateTime.now end end
Version data entries
5 entries across 5 versions & 1 rubygems
Version | Path |
---|---|
udongo-2.0.4 | app/models/email.rb |
udongo-2.0.3 | app/models/email.rb |
udongo-2.0.2 | app/models/email.rb |
udongo-2.0.1 | app/models/email.rb |
udongo-2.0.0 | app/models/email.rb |