Sha256: 730ed6869528464115aacf102219a4bb8f013a665cd8db3cd0dc98fb567068b3
Contents?: true
Size: 1.04 KB
Versions: 15
Compression:
Stored size: 1.04 KB
Contents
class <%= class_name %><%= "< #{options[:parent].classify}" if parent? %> <% unless parent? -%> include MongoMapper::Document <% end -%> <%= statements %> <% unless parent? -%> # Validations ::::::::::::::::::::::::::::::::::::::::::::::::::::: # validates_presence_of :attribute # Assocations ::::::::::::::::::::::::::::::::::::::::::::::::::::: # belongs_to :model # many :model # one :model # Callbacks ::::::::::::::::::::::::::::::::::::::::::::::::::::::: # before_create :your_model_method # after_create :your_model_method # before_update :your_model_method # Attribute options extras :::::::::::::::::::::::::::::::::::::::: # attr_accessible :first_name, :last_name, :email # Validations # key :name, :required => true # Defaults # key :done, :default => false # Typecast # key :user_ids, Array, :typecast => 'ObjectId' <% end -%> <% model_attributes.each_with_index do |attribute, i| -%> key :<%= attribute.name %>, <%= attribute.type_class %><%= ", :index => true" if model_indexes[attribute.name] %> <% end -%> end
Version data entries
15 entries across 15 versions & 1 rubygems