Sha256: 27091825f8aa9c9b4631d1422327b44c45f342bdda4d62c74b59edd6e4f1d4f0
Contents?: true
Size: 413 Bytes
Versions: 13
Compression:
Stored size: 413 Bytes
Contents
class Profile include Mongoid::Document field :first_name field :last_name field :age field :hobbies, type: Array, default: [] embedded_in :user, inverse_of: :profile validates :age, numericality: { greater_than: 0 } validates :terms_of_service, acceptance: true validates :hobbies, length: { minimum: 1, message: "requires at least one hobby" } index({ first_name: 1, last_name: 1 }) end
Version data entries
13 entries across 13 versions & 4 rubygems