Sha256: b525f2caa5f30195dfdaa4805a8b02c45f6b703f11afa873326ad18e7f54eb07

Contents?: true

Size: 814 Bytes

Versions: 1

Compression:

Stored size: 814 Bytes

Contents

class User

  include Mongoid::Document

  field :first_name, :type => String
  field :last_name, :type => String
  field :age, :type => Integer
  field :active, :type => Boolean
  field :created_at, :type => DateTime
  field :updated_at, :type => DateTime

  embeds_one :profile, :class_name => "Profile", :inverse_of => :user
  embeds_many :tasks, :class_name => "Task", :inverse_of => :user

  validates :first_name, :last_name, :presence => true

  acts_as_api

  include SharedEngine::UserTemplate

  def over_thirty?
    age > 30
  end

  def under_thirty?
    age < 30
  end

  def return_nil
    nil
  end

  def full_name
    '' << first_name.to_s << ' ' << last_name.to_s
  end

  def say_something
    "something"
  end

  def sub_hash
    {
      :foo => "bar",
      :hello => "world"
    }
  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
acts_as_api-0.4 spec/mongoid_dummy/app/models/user.rb