Sha256: 3b12fa5b24ba802bfa5a5513f26d6ab38ca1bba2ea4535acb3996b0a42679938

Contents?: true

Size: 503 Bytes

Versions: 6

Compression:

Stored size: 503 Bytes

Contents

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

<% 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/embedded_model/templates/embedded_model.rb
mongo_mapper_generators-1.0.4 rails_generators/embedded_model/templates/embedded_model.rb
mongo_mapper_generators-1.0.3 rails_generators/embedded_model/templates/embedded_model.rb
mongo_mapper_generators-1.0.2 rails_generators/embedded_model/templates/embedded_model.rb
mongo_mapper_generators-1.0.1 rails_generators/embedded_model/templates/embedded_model.rb
mongo_mapper_generators-1.0.0 rails_generators/embedded_model/templates/embedded_model.rb