module Mongomatic::TypedFields

Typed Fields

Explicitly specify the field types in your document. This is completely optional. You can also set whether or not we should try to automatically cast a type to the desired type.

Examples

typed_field "age",                :type => :fixnum,  :cast => true
typed_field "manufacturer.name",  :type => :string,  :cast => false

Constants

KNOWN_TYPES

Public Class Methods

included(base) click to toggle source
# File lib/mongomatic/typed_fields.rb, line 15
def self.included(base)
  base.send(:extend,  ClassMethods)
  base.send(:include, InstanceMethods)
end