Sha256: bf80e1cc6a9b032352c430977c6a5ae6354bd4f25460cfb372f6012ac0790717

Contents?: true

Size: 671 Bytes

Versions: 6

Compression:

Stored size: 671 Bytes

Contents

# == Schema Information
#
# Table name: got_fixed_users
#
#  id         :integer          not null, primary key
#  email      :string(255)
#  created_at :datetime
#  updated_at :datetime
#

module GotFixed
  class User < ActiveRecord::Base
    validates_presence_of :email
    validates_uniqueness_of :email
    validates_format_of :email, :with => /\A([-a-z0-9!\#$%&'*+\/=?^_`{|}~]+\.)*[-a-z0-9!\#$%&'*+\/=?^_`{|}~]+@((?:[-a-z0-9]+\.)+[a-z]{2,})\Z/i

    has_and_belongs_to_many :issues

    def send_notification(issue)
      # TODO(ssaunier): async send (SMTP is slow !!)
      mail = UserMailer.issue_got_fixed_email(self, issue)
      mail.deliver
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
got_fixed-0.0.6 app/models/got_fixed/user.rb
got_fixed-0.0.5 app/models/got_fixed/user.rb
got_fixed-0.0.4 app/models/got_fixed/user.rb
got_fixed-0.0.3 app/models/got_fixed/user.rb
got_fixed-0.0.2 app/models/got_fixed/user.rb
got_fixed-0.0.1 app/models/got_fixed/user.rb