Sha256: b7f67b7b48fa0f6ebc229dd5c143ea23f1a8587d6af69c4b76d9d2548637a07c

Contents?: true

Size: 495 Bytes

Versions: 6

Compression:

Stored size: 495 Bytes

Contents

class <%= class_name %>
  include MongoMapper::Document

<% if attributes.any? -%>
<% attributes.each do |attribute| -%>
  key :<%= attribute.name %>, <%= attribute.type %>
<% end -%>
<% end -%>

<% if many.any? -%>
<% many.each do |each| -%>
  many :<%= each.type %>
<% end -%>
<% end -%>

<% if belongs.any? -%>
<% belongs.each do |each| -%>
  belongs_to :<%= each.type %>
<% end -%>
<% end -%>

<% if timestamps -%>
  timestamps!
<% end -%>

<% if userstamps -%>
  userstamps!
<% end -%>
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
mongo_mapper_generators-1.0.5 rails_generators/mongo_model/templates/mongo_model.rb
mongo_mapper_generators-1.0.4 rails_generators/mongo_model/templates/mongo_model.rb
mongo_mapper_generators-1.0.3 rails_generators/mongo_model/templates/mongo_model.rb
mongo_mapper_generators-1.0.2 rails_generators/mongo_model/templates/mongo_model.rb
mongo_mapper_generators-1.0.1 rails_generators/mongo_model/templates/mongo_model.rb
mongo_mapper_generators-1.0.0 rails_generators/mongo_model/templates/mongo_model.rb