engine/app/models/account.rb
2010-04-13 16:26:40 +02:00

24 lines
493 B
Ruby

class Account
include Mongoid::Document
include Mongoid::Timestamps
# devise modules
devise :database_authenticatable, :recoverable, :rememberable, :trackable, :validatable #:registerable,
# attr_accessible :email, :password, :password_confirmation # TODO
## attributes ##
field :name
field :locale, :default => 'en'
## validations ##
validates_presence_of :name
## associations ##
def sites
Site.where({ :account_ids => self._id })
end
end