Skip to content

Commit

Permalink
Added namespacing to model generator
Browse files Browse the repository at this point in the history
  • Loading branch information
bhbryant committed Dec 4, 2011
1 parent 1246133 commit 06a2d4c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/rails/generators/mongo_mapper/model/model_generator.rb
Expand Up @@ -14,7 +14,7 @@ def self.source_root
end

def create_model_file
template 'model.rb', File.join('app/models', "#{file_name}.rb")
template 'model.rb', File.join('app/models', class_path, "#{file_name}.rb")
end

hook_for :test_framework
Expand Down
2 changes: 2 additions & 0 deletions lib/rails/generators/mongo_mapper/model/templates/model.rb
@@ -1,3 +1,4 @@
<% module_namespacing do -%>
class <%= class_name %>
include MongoMapper::Document

Expand All @@ -9,3 +10,4 @@ class <%= class_name %>
<% end -%>
end
<% end -%>

0 comments on commit 06a2d4c

Please sign in to comment.