Sha256: 6ce80121f7f614252361b7805cfaac48b83b85fd321ab3d0c4ec57fdc5eb4ba9

Contents?: true

Size: 652 Bytes

Versions: 193

Compression:

Stored size: 652 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%>, :inverse_of => :<%= class_name.tableize %>
<% end -%>
end
<% end -%>

Version data entries

193 entries across 101 versions & 5 rubygems

Version Path
classiccms-0.7.5 vendor/bundle/gems/mongoid-2.4.10/lib/rails/generators/mongoid/model/templates/model.rb.tt
classiccms-0.7.5 vendor/bundle/gems/mongoid-2.4.9/lib/rails/generators/mongoid/model/templates/model.rb.tt
classiccms-0.7.5 vendor/bundle/gems/mongoid-2.4.7/lib/rails/generators/mongoid/model/templates/model.rb.tt
classiccms-0.7.4 vendor/bundle/gems/mongoid-2.4.9/lib/rails/generators/mongoid/model/templates/model.rb.tt
classiccms-0.7.4 vendor/bundle/gems/mongoid-2.4.7/lib/rails/generators/mongoid/model/templates/model.rb.tt
classiccms-0.7.4 vendor/bundle/gems/mongoid-2.4.10/lib/rails/generators/mongoid/model/templates/model.rb.tt
classiccms-0.7.3 vendor/bundle/gems/mongoid-2.4.7/lib/rails/generators/mongoid/model/templates/model.rb.tt
classiccms-0.7.3 vendor/bundle/gems/mongoid-2.4.10/lib/rails/generators/mongoid/model/templates/model.rb.tt
classiccms-0.7.3 vendor/bundle/gems/mongoid-2.4.9/lib/rails/generators/mongoid/model/templates/model.rb.tt
mongoid-2.8.1 lib/rails/generators/mongoid/model/templates/model.rb.tt
mongoid-2.8.0 lib/rails/generators/mongoid/model/templates/model.rb.tt
classiccms-0.7.2 vendor/bundle/gems/mongoid-2.4.10/lib/rails/generators/mongoid/model/templates/model.rb.tt
classiccms-0.7.2 vendor/bundle/gems/mongoid-2.4.7/lib/rails/generators/mongoid/model/templates/model.rb.tt
classiccms-0.7.2 vendor/bundle/gems/mongoid-2.4.9/lib/rails/generators/mongoid/model/templates/model.rb.tt
classiccms-0.7.1 vendor/bundle/gems/mongoid-2.4.10/lib/rails/generators/mongoid/model/templates/model.rb.tt
classiccms-0.7.1 vendor/bundle/gems/mongoid-2.4.7/lib/rails/generators/mongoid/model/templates/model.rb.tt
classiccms-0.7.1 vendor/bundle/gems/mongoid-2.4.9/lib/rails/generators/mongoid/model/templates/model.rb.tt
classiccms-0.7.0 vendor/bundle/gems/mongoid-2.4.9/lib/rails/generators/mongoid/model/templates/model.rb.tt
classiccms-0.7.0 vendor/bundle/gems/mongoid-2.4.10/lib/rails/generators/mongoid/model/templates/model.rb.tt
classiccms-0.7.0 vendor/bundle/gems/mongoid-2.4.7/lib/rails/generators/mongoid/model/templates/model.rb.tt