Created
May 5, 2015 19:46
-
-
Save hayduke19us/7b00e963a241c5a5f07b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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