This project is archived and is in readonly mode.
polymorphic_url should treat an array contains single name as without the container
Reported by hiroshi | November 16th, 2008 @ 09:20 AM | in 2.x
After I posted #1317, I realized I missed one more feature I want to be patched.
You may see what I want by an excerpt from my new patch.
def test_with_array_containing_single_name
@article.save
expects(:articles_url)
polymorphic_url([:articles])
end
That it.
Comments and changes to this ticket
-
DHH November 16th, 2008 @ 08:44 PM
I'm not sure I quite understand what this does? What was the behavior before this?
-
hiroshi November 17th, 2008 @ 02:08 AM
Before this change, the test I added failed.
1) Error: test_with_array_containing_single_name(PolymorphicRoutesTest): NoMethodError: undefined method `articles_nil_class_url' for #<PolymorphicRoutesTest:0x1045528>
However, giving an array consists of an object doesn't raise NoMethodError nor any.
def test_with_array_containing_single_object @article.save expects(:article_url).with(@article) polymorphic_url([nil, @article]) # argument will be [@article] with former patch #1317 end
I wish this explain my intention.
-
Repository November 19th, 2008 @ 11:07 AM
- State changed from new to committed
(from [591560c641d52f6a8fb12a26c60c3f812735ac0d]) Let polymorphic_path treat an array contains single name as without array [#1386 state:committed]
Signed-off-by: David Heinemeier Hansson david@loudthinking.com http://github.com/rails/rails/co...
-
Repository November 19th, 2008 @ 11:07 AM
(from [291d199de1271c254c44b94766d13013b222a125]) Let polymorphic_path treat an array contains single name as without array [#1386 state:committed]
Signed-off-by: David Heinemeier Hansson david@loudthinking.com http://github.com/rails/rails/co...
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
<h2 style="font-size: 14px">Tickets have moved to Github</h2>
The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>
People watching this ticket
Attachments
Referenced by
- 1386 polymorphic_url should treat an array contains single name as without the container (from [591560c641d52f6a8fb12a26c60c3f812735ac0d]) Let pol...
- 1386 polymorphic_url should treat an array contains single name as without the container (from [291d199de1271c254c44b94766d13013b222a125]) Let pol...