Jeffrey C Jeffrey C - 1 year ago 87
Ruby Question

Where can I find a specific documentation for a Mongoid class?

I am new to Mongoid and I want to learn more about it. Today I came across

in here .

It looks interesting to me so I wanted to know more about it, but could not find any more documentation on
. I've currently tried searching here, in Class List, Method List and File List, but didn't find anything.

Seems like Mongoid has a very limited documentation.

Answer Source

You can read its RubyDoc to find more about Mongoid::Timestamps. It's nothing special, but in a nutshell:

Including Mongoid::Timestamps in your Ruby model classes would tell MongoDB to save timestamps of when a document was created or updated. This creates two new attributes in your model:

  • created_at
  • updated_at

You use it like this:

class User
  include Mongoid::Document
  include Mongoid::Timestamps

  # Other stuff...
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download