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.

"warning: default 'to_a' will be obsolete" from method_missing in association_proxy

#2121

I get dozens of warnings like this every time I save since I switch from Rails 1 to Rails 2. I've done lots of cleaning up and debugging, but so far have not even found a way to trace what causes it. The warning looks like this:

/usr/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/associations/association_proxy.rb:214: warning: default to_a' will be obsolete

Any ideas on at least how I could trace it?

Reported by Ari Epstein · March 3rd, 2009 @ 08:14 PM

State: invalid
Milestone: 2.x
Assigned to: nobody
Importance: none

Activity

  1. Simon Chiu
    Simon Chiu

    I suspect it is a named scope problem. I added some name scopes and then this popped up. Still trying to track it down myself.

    April 28th, 2009 @ 01:49 PM

  2. Andrew France
    Andrew France

    If you unpack rails into the vendor directory you could add something like this immediately before the line that generates the warning in association_proxy:

    puts caller.inspect if method.to_s == 'to_a'
    
    (I guess log.info may work instead of puts.)

    June 11th, 2009 @ 07:04 PM

  3. Ari Epstein
    Ari Epstein

    I resolved this using the suggestion above. Turned out I need to change the following:


    {mkd-extraction-ad9d79ea10d3bb971dfb385a3ee01617}

    To:


    {mkd-extraction-6f8ad3a4d7c861170ca64e9dd6eb63ea}

    November 7th, 2009 @ 03:02 PM

  4. Rizwan Reza
    Rizwan Reza
    • State changed from new to invalid

    January 20th, 2010 @ 10:10 AM