Skip to content

Instantly share code, notes, and snippets.

@hayduke19us
Created May 5, 2015 19:46
Show Gist options
  • Save hayduke19us/7b00e963a241c5a5f07b to your computer and use it in GitHub Desktop.
Save hayduke19us/7b00e963a241c5a5f07b to your computer and use it in GitHub Desktop.
class Admin < ActiveRecord::Base
# Include default devise modules. Others available are:
# :confirmable, :lockable, :timeoutable and :omniauthable
devise :database_authenticatable, :registerable,
:recoverable, :rememberable, :trackable, :validatable
validates :key, format: {with: /\A#{ENV["admin_key"]}/}
def self.send_report_notification report
all.each do |a|
IntelMail.delay.new_report a.email, report
end
end
def handle
self.email.split('@').first
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment