Module: Mongo::Model::Misc::ClassMethods

Defined in:
lib/mongo/model/misc.rb

Instance Method Summary collapse

Instance Method Details

#create_index(*args) ⇒ Object



48
49
50
# File 'lib/mongo/model/misc.rb', line 48

def create_index *args
  collection.create_index *args
end

#timestamps!Object



42
43
44
45
46
# File 'lib/mongo/model/misc.rb', line 42

def timestamps!
  attr_accessor :created_at, :updated_at
  before_create :update_created_at
  before_save :update_updated_at
end