Skip to content

Commit

Permalink
Add namespace support for model generation
Browse files Browse the repository at this point in the history
Especially useful for writing Rails engines
  • Loading branch information
Bradley Grzesiak and Josh Swan authored and durran committed Mar 5, 2011
1 parent 0eefe16 commit bb3e139
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/rails/generators/mongoid/model/templates/model.rb
@@ -1,3 +1,4 @@
<% module_namespacing do -%>
class <%= class_name %><%= " < #{options[:parent].classify}" if options[:parent] %>
<% unless options[:parent] -%>
include Mongoid::Document
Expand All @@ -15,3 +16,4 @@ class <%= class_name %><%= " < #{options[:parent].classify}" if options[:parent]
embedded_in :<%= attribute.name%>, :inverse_of => :<%= class_name.tableize %>
<% end -%>
end
<% end -%>

0 comments on commit bb3e139

Please sign in to comment.