Sha256: 3c165556e0979d9d1ae0310e9963056edc33740be8398a31b9b1d965d26129b1
Contents?: true
Size: 523 Bytes
Versions: 6
Compression:
Stored size: 523 Bytes
Contents
class User include Mongoid::Document field :login field :email field :role has_many_related :articles has_many_related :comments embeds_one :profile validates :login, :presence => true, :uniqueness => true, :format => { :with => /^[\w\-]+$/ } validates :email, :presence => true, :uniqueness => true validates :role, :presence => true, :inclusion => { :in => ["admin", "moderator", "member"]} validates :profile, :presence => true, :associated => true def admin? false end end
Version data entries
6 entries across 6 versions & 2 rubygems