aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoshua Peek <josh@joshpeek.com>2008-10-13 21:43:58 -0500
committerJoshua Peek <josh@joshpeek.com>2008-10-13 21:43:58 -0500
commit9ab83b1cd1323e0ffebbd287c38aff614c18822c (patch)
tree655e68ea0da4e92f8bfde02b1f14fd95ee71e6bb
parentc51db4d7ababd6f1c341d2808a298865ee449313 (diff)
downloadrails-9ab83b1cd1323e0ffebbd287c38aff614c18822c.tar.gz
rails-9ab83b1cd1323e0ffebbd287c38aff614c18822c.tar.bz2
rails-9ab83b1cd1323e0ffebbd287c38aff614c18822c.zip
Don't include the path when checking class collisions [#545 state:resolved]
-rw-r--r--railties/lib/rails_generator/commands.rb1
-rw-r--r--railties/test/generators/rails_controller_generator_test.rb3
2 files changed, 4 insertions, 0 deletions
diff --git a/railties/lib/rails_generator/commands.rb b/railties/lib/rails_generator/commands.rb
index 59af7308fe..6b9a636847 100644
--- a/railties/lib/rails_generator/commands.rb
+++ b/railties/lib/rails_generator/commands.rb
@@ -169,6 +169,7 @@ HELP
# Ruby or Rails. In the future, expand to check other namespaces
# such as the rest of the user's app.
def class_collisions(*class_names)
+ path = class_names.shift
class_names.flatten.each do |class_name|
# Convert to string to allow symbol arguments.
class_name = class_name.to_s
diff --git a/railties/test/generators/rails_controller_generator_test.rb b/railties/test/generators/rails_controller_generator_test.rb
index 8304fb5a01..f839ea97e6 100644
--- a/railties/test/generators/rails_controller_generator_test.rb
+++ b/railties/test/generators/rails_controller_generator_test.rb
@@ -1,5 +1,8 @@
require 'generators/generator_test_helper'
+module Admin
+end
+
class RailsControllerGeneratorTest < GeneratorTestCase
def test_controller_generates_controller