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.

add test case to specify behaviour of _assigns in ActionView::TestCase

#5751

http://github.com/rails/rails/commit/e66c1cee86aba1c81152f3d0872313... changed the behaviour of ActionView::TestCase@_assigns to return an Array instead of a Hash. This broke extensions that rely on _assigns, so http://github.com/rails/rails/commit/b95152201871f076a0d5c95e9e6387... reverted it.

Forthcoming patch adds a test case, which specifies that _assigns returns a Hash.

Reported by David Chelimsky · October 2nd, 2010 @ 01:15 PM

State: resolved
Milestone: none
Assigned to: José Valim José Valim
Importance: Low

Activity

  1. David Chelimsky
  2. David Chelimsky
    David Chelimsky

    Here's a different patch that also renames _assigns to user_defined_ivar_map (more self-documenting):

    http://github.com/dchelimsky/rails/commit/401630298c59aecb468bcfd4d...

    October 2nd, 2010 @ 06:17 PM

  3. David Chelimsky
    David Chelimsky

    Here's yet another alternative! This one uses _user_defined... internally to clarify the separation between them and internally defined ivars, but exposes view_assigns to align with controllers.

    http://github.com/dchelimsky/rails/commit/14bf17deb8fc8235b3a4f989d...

    October 2nd, 2010 @ 06:37 PM

  4. Repository
  5. Repository
  6. David Chelimsky
  7. David Chelimsky
    David Chelimsky

    Hi Santiago. I see that you merged one patch to rails/3-0-stable and another to master. My hope was for the last patch to replace the others and be merged to both 3-0-stable and master.

    The intent was to deprecate _assigns as of 3.0.1 so it could be removed when 3.1.0 is released (I can add another patch for master to remove it from 3.1.0 if you like).

    Also, re: the test case, I see you modified it to allow for internally defined instance variables, but my intent was to lock down the content of view_assigns to include only user defined instance variables. That keeps the view free of instance variables that are used internally by ActionView::TestCase.

    WDYT?

    I also see you modified the test case to allow for other instance variables making it into _assigns.

    My intent was for the last patch (https://rails.lighthouseapp.com/projects/8994/changesets/f656796d05...) to replace the others with the hope that it would be merged to both 3-0-stable

    October 4th, 2010 @ 03:02 PM

  8. David Chelimsky
    David Chelimsky

    Spoke w/ José and we agreed view_assigns should be added and _assigns deprecated on the 3-0-stable branch (so _assigns can be removed from 3.1).

    Here's a new patch which brings my changes to 3-0-stable, leaving Santiago's perf improvement on view_assigns intact:

    http://github.com/dchelimsky/rails/commit/33706a0db290ab22aaaa56b7e...

    October 4th, 2010 @ 04:12 PM

  9. Ryan Bigg
    Ryan Bigg
    • Importance changed from to Low

    Automatic cleanup of spam.

    October 11th, 2010 @ 12:10 PM

  10. Ryan Bigg
    Ryan Bigg

    Automatic cleanup of spam.

    October 14th, 2010 @ 05:29 AM