diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2005-02-15 19:35:13 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2005-02-15 19:35:13 +0000 |
commit | b04618e707a73d2bcd617fd82e54e736736158b1 (patch) | |
tree | 5091ba6b63486cfbb4eca4c349d224d208877567 /railties/lib/rails_generator/base.rb | |
parent | 575ad6d4451451add07190477cb55f6b1aa97c7d (diff) | |
download | rails-b04618e707a73d2bcd617fd82e54e736736158b1.tar.gz rails-b04618e707a73d2bcd617fd82e54e736736158b1.tar.bz2 rails-b04618e707a73d2bcd617fd82e54e736736158b1.zip |
Fixed generated functional test for nested controllers has wrong paths #635
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@631 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'railties/lib/rails_generator/base.rb')
-rw-r--r-- | railties/lib/rails_generator/base.rb | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/railties/lib/rails_generator/base.rb b/railties/lib/rails_generator/base.rb index eafc99728c..f7aa2169ca 100644 --- a/railties/lib/rails_generator/base.rb +++ b/railties/lib/rails_generator/base.rb @@ -145,7 +145,7 @@ module Rails # See Rails::Generator::Base for a discussion of Manifests and Commands. class NamedBase < Base attr_reader :name, :class_name, :singular_name, :plural_name - attr_reader :class_path, :class_nesting + attr_reader :class_path, :file_path, :class_nesting, :class_nesting_depth alias_method :file_name, :singular_name alias_method :table_name, :plural_name alias_method :actions, :args @@ -170,7 +170,7 @@ module Rails private def assign_names!(name) @name = name - base_name, @class_path, @class_nesting = extract_modules(@name) + base_name, @class_path, @file_path, @class_nesting, @class_nesting_depth = extract_modules(@name) @class_name_without_nesting, @singular_name, @plural_name = inflect_names(base_name) if @class_nesting.empty? @class_name = @class_name_without_nesting @@ -187,8 +187,9 @@ module Rails modules = name.include?('/') ? name.split('/') : name.split('::') name = modules.pop path = modules.map { |m| m.underscore } + file_path = (path + [name.underscore]).join('/') nesting = modules.map { |m| m.camelize }.join('::') - [name, path, nesting] + [name, path, file_path, nesting, modules.size] end def inflect_names(name) |