Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

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

#5154

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.

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

State: stale
Milestone: none
Assigned to: nobody
Importance: none

Activity

  1. kaipr
    kaipr

    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

    January 13th, 2011 @ 06:52 PM

  2. kaipr
    kaipr

    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.

    January 13th, 2011 @ 07:29 PM

  3. rails
    rails
    • 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.

    April 14th, 2011 @ 01:00 AM

  4. rails
    rails
    • State changed from open to stale

    April 14th, 2011 @ 01:00 AM