Sha256: eae0a262dc34d293afbce2b0af9ebe2626abe36bdf07a3233e69e5f2ddd9967d

Contents?: true

Size: 605 Bytes

Versions: 24

Compression:

Stored size: 605 Bytes

Contents

<% module_namespacing do -%>
class <%= class_name %><%= " < #{options[:parent].classify}" if options[:parent] %>
<% unless options[:parent] -%>
  include Mongoid::Document
<% end -%>
<% if options[:timestamps] -%>
  include Mongoid::Timestamps
<% end -%>
<% if options[:versioning] -%>
  include Mongoid::Versioning
<% end -%>
<% attributes.reject{|attr| attr.reference?}.each do |attribute| -%>
  field :<%= attribute.name %>, type: <%= attribute.type_class %>
<% end -%>
<% attributes.select{|attr| attr.reference? }.each do |attribute| -%>
  embedded_in :<%= attribute.name%>
<% end -%>
end
<% end -%>

Version data entries

24 entries across 24 versions & 2 rubygems

Version Path
mongoid-3.0.23 lib/rails/generators/mongoid/model/templates/model.rb.tt
mongoid-3.0.22 lib/rails/generators/mongoid/model/templates/model.rb.tt
mongoid-3.0.21 lib/rails/generators/mongoid/model/templates/model.rb.tt
mongoid-3.0.20 lib/rails/generators/mongoid/model/templates/model.rb.tt
mongoid-3.0.19 lib/rails/generators/mongoid/model/templates/model.rb.tt
mongoid-3.0.18 lib/rails/generators/mongoid/model/templates/model.rb.tt
mongoid-3.0.17 lib/rails/generators/mongoid/model/templates/model.rb.tt
sunrise-cms-0.5.0.rc1 vendor/bundle/ruby/1.9.1/gems/mongoid-3.0.16/lib/rails/generators/mongoid/model/templates/model.rb.tt
mongoid-3.0.16 lib/rails/generators/mongoid/model/templates/model.rb.tt
mongoid-3.0.15 lib/rails/generators/mongoid/model/templates/model.rb.tt
mongoid-3.0.14 lib/rails/generators/mongoid/model/templates/model.rb.tt
mongoid-3.0.13 lib/rails/generators/mongoid/model/templates/model.rb.tt
mongoid-3.0.12 lib/rails/generators/mongoid/model/templates/model.rb.tt
mongoid-3.0.11 lib/rails/generators/mongoid/model/templates/model.rb.tt
mongoid-3.0.10 lib/rails/generators/mongoid/model/templates/model.rb.tt
mongoid-3.0.9 lib/rails/generators/mongoid/model/templates/model.rb.tt
mongoid-3.0.6 lib/rails/generators/mongoid/model/templates/model.rb.tt
mongoid-3.0.5 lib/rails/generators/mongoid/model/templates/model.rb.tt
mongoid-3.0.4 lib/rails/generators/mongoid/model/templates/model.rb.tt
mongoid-3.0.3 lib/rails/generators/mongoid/model/templates/model.rb.tt