Method: MongoModel::DocumentExtensions::Persistence#update_attribute

Defined in:
lib/mongomodel/document/persistence.rb

#update_attribute(name, value) ⇒ Object

Updates a single attribute and saves the document without going through the normal validation procedure. This is especially useful for boolean flags on existing documents.



68
69
70
71
# File 'lib/mongomodel/document/persistence.rb', line 68

def update_attribute(name, value)
  send("#{name}=", value)
  save(:validate => false)
end