class User < ActiveRecord::Base
  # Include default devise modules. Others available are:
  # :confirmable, :lockable, :timeoutable and :omniauthable
  devise :database_authenticatable, :registerable,
         :recoverable, :rememberable, :trackable, :validatable

  validates :name, presence: true
  has_many :retrospective_users, dependent: :destroy
  has_many :labels

  def as_json(options = nil)
    {
      id: id,
      name: name
    }
  end
end
