[1.9] Array#join using to_a instead of to_s when both defined
-------------------------------------------------------------

                 Key: JRUBY-5394
                 URL: http://jira.codehaus.org/browse/JRUBY-5394
             Project: JRuby
          Issue Type: Bug
          Components: Core Classes/Modules
    Affects Versions: JRuby 1.6RC1, JRuby 1.6RC2
         Environment: jruby 1.6.0.RC1 (ruby 1.9.2 trunk 136) (2011-01-10 
769f847) (Java HotSpot(TM) 64-Bit Server VM 1.6.0_22) [darwin-x86_64-java]
            Reporter: Micah Alles
         Attachments: join_using_to_a_test.rb

When both the #to_a and #to_s methods are defined on an object in an array 
which #join is called on, #to_a is used instead of #to_s for determining the 
string value of the object which is joined.  The return value of the #to_a call 
also seems to be flattened with the containing array before the join is applied.

This is causing a problem with url slug generation of Mongoid documents in 
rails 3.

A test/unit testcase for this issue is attached. This issue only occurs when 
enabling 1.9 support with --1.9. This test passes on MRI 1.9.2 and JRuby 1.6RC1 
--1.8.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply via email to