MorningPeak/app/models/admin.rb
2015-06-19 21:35:15 +02:00

18 lines
421 B
Ruby

class Admin < ActiveRecord::Base
# Include default devise modules. Others available are:
# :confirmable, :lockable, :timeoutable and :omniauthable
devise :database_authenticatable,
#:registerable,
#:recoverable,
:rememberable#,
#:trackable,
#:validatable
has_many :tickets, as: :creator
def tickets_unview
Ticket.all.heads.where(admin_view_at: nil)
end
end