This project is archived and is in readonly mode.

#5154 ✓stale
Mat Schaffer

fixture_path processing assumes a trailing slash ('/') on path

Reported by Mat Schaffer | July 19th, 2010 @ 08:14 PM

On MRI this isn't an issue, but on Rubinius, Dir.glob doesn't include extraneous slashes in the file path which causes the fixture -> table mapping to break.

Fixture path is set on http://github.com/rails/rails/blob/master/railties/lib/rails/test_h... and processed on http://github.com/rails/rails/blob/master/activerecord/lib/active_r...

Gist example is at http://gist.github.com/481814

The rubyspec doesn't say anything on this point, but specifying the fixture_path with the trailing slash seems like the wrong way to go.

Comments and changes to this ticket

  • kaipr

    kaipr January 13th, 2011 @ 06:52 PM

    This is still an issue with current Rails and Rubinius HEAD versions.

    I've spoken with Evan from Rubinius and he will fix that behavior of Dir. It already behaves like MRI in almost all situations, but there still is a problem with // followed by two stars (see gist).

    To fix this for current and old Rubinius versions (and to make that code a bit cleaner) I would suggest a tiny change in ARs implementation (see gist or diff [dont know if a 2 line change needs, but I included it])

    Gist: https://gist.github.com/778369

    Another confirmation of this problem in AR (bit dated): http://forums.pragprog.com/forums/148/topics/7134

  • kaipr

    kaipr January 13th, 2011 @ 07:29 PM

    Have to say my first suggestion needs a trailing slash on fixture_path (which may be the reason for the original implementation), I've added an regex version which feels kinda clumsy too but should work.

    Maybe someone has a better solution, i'll give it another try tomorrow.

  • rails

    rails April 14th, 2011 @ 01:00 AM

    • State changed from “new” to “open”

    This issue has been automatically marked as stale because it has not been commented on for at least three months.

    The resources of the Rails core team are limited, and so we are asking for your help. If you can still reproduce this error on the 3-0-stable branch or on master, please reply with all of the information you have about it and add "[state:open]" to your comment. This will reopen the ticket for review. Likewise, if you feel that this is a very important feature for Rails to include, please reply with your explanation so we can consider it.

    Thank you for all your contributions, and we hope you will understand this step to focus our efforts where they are most helpful.

  • rails

    rails April 14th, 2011 @ 01:00 AM

    • State changed from “open” to “stale”

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

Pages