engine/app/models/account.rb

24 lines
493 B
Ruby
Raw Normal View History

2010-04-09 09:23:41 +00:00
class Account
include Mongoid::Document
include Mongoid::Timestamps
2010-04-09 09:23:41 +00:00
# devise modules
2010-04-13 14:26:40 +00:00
devise :database_authenticatable, :recoverable, :rememberable, :trackable, :validatable #:registerable,
# attr_accessible :email, :password, :password_confirmation # TODO
2010-04-09 09:23:41 +00:00
## attributes ##
field :name
field :locale, :default => 'en'
## validations ##
validates_presence_of :name
## associations ##
def sites
Site.where({ :account_ids => self._id })
end
2010-04-09 09:23:41 +00:00
end