aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--activemodel/test/cases/conversion_test.rb4
-rw-r--r--activemodel/test/models/helicopter.rb4
2 files changed, 8 insertions, 0 deletions
diff --git a/activemodel/test/cases/conversion_test.rb b/activemodel/test/cases/conversion_test.rb
index d679ad41aa..a037666cbc 100644
--- a/activemodel/test/cases/conversion_test.rb
+++ b/activemodel/test/cases/conversion_test.rb
@@ -29,4 +29,8 @@ class ConversionTest < ActiveModel::TestCase
assert_equal "helicopters/helicopter", Helicopter.new.to_partial_path,
"ActiveModel::Conversion#to_partial_path caching should be class-specific"
end
+
+ test "to_partial_path handles namespaced models" do
+ assert_equal "helicopter/comanches/comanche", Helicopter::Comanche.new.to_partial_path
+ end
end
diff --git a/activemodel/test/models/helicopter.rb b/activemodel/test/models/helicopter.rb
index a52b6fb4dd..933f3c463a 100644
--- a/activemodel/test/models/helicopter.rb
+++ b/activemodel/test/models/helicopter.rb
@@ -1,3 +1,7 @@
class Helicopter
include ActiveModel::Conversion
end
+
+class Helicopter::Comanche
+ include ActiveModel::Conversion
+end