Sha256: 04ca73dbdf68ed4636326bbb315efb647e3e9339a7769721a8ac593c31fbc684

Contents?: true

Size: 414 Bytes

Versions: 42

Compression:

Stored size: 414 Bytes

Contents

class Email < ApplicationRecord
  validates :from_name, :to_name, :subject, :plain_content, :html_content,
            presence: true
  validates :from_email, :to_email, email: true
  validates :cc, :bcc, email: true, allow_blank: true

  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

42 entries across 42 versions & 1 rubygems

Version Path
udongo-7.2.1 app/models/email.rb
udongo-7.2.0 app/models/email.rb
udongo-7.1.3 app/models/email.rb
udongo-7.1.2 app/models/email.rb
udongo-7.1.1 app/models/email.rb
udongo-7.1.0 app/models/email.rb
udongo-7.0.4 app/models/email.rb
udongo-7.0.3 app/models/email.rb
udongo-7.0.2 app/models/email.rb
udongo-7.0.1 app/models/email.rb
udongo-7.0.0 app/models/email.rb
udongo-6.6.3 app/models/email.rb
udongo-6.6.2 app/models/email.rb
udongo-6.6.1 app/models/email.rb
udongo-6.6.0 app/models/email.rb
udongo-6.5.2 app/models/email.rb
udongo-6.5.1 app/models/email.rb
udongo-6.5.0 app/models/email.rb
udongo-6.4.1 app/models/email.rb
udongo-6.4.0 app/models/email.rb