user.rb 380 Bytes
Newer Older
Eugen Rochko's avatar
Eugen Rochko committed
1
class User < ActiveRecord::Base
2 3
  devise :database_authenticatable, :registerable, :recoverable, :rememberable, :trackable, :validatable

Eugen Rochko's avatar
Eugen Rochko committed
4
  belongs_to :account, inverse_of: :user
5
  accepts_nested_attributes_for :account
6

Eugen Rochko's avatar
Eugen Rochko committed
7
  validates :account, presence: true
8 9

  has_many :oauth_applications, class_name: 'Doorkeeper::Application', as: :owner
10 11 12 13

  def admin?
    self.admin
  end
Eugen Rochko's avatar
Eugen Rochko committed
14
end