MorningPeak/app/models/admin.rb
Arthur Poulet 7646e982d3 fix comment, implementation
- creator polymorphic instead of user
- implementation
2015-07-25 22:30:19 +02:00

19 lines
456 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
has_many :comments, as: :creator
def tickets_unview
Ticket.all.heads.where(admin_view_at: nil)
end
end