This project is archived and is in readonly mode.

#2121 ✓invalid
Ari Epstein

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

Reported by Ari Epstein | March 3rd, 2009 @ 08:14 PM | in 2.x

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?

Comments and changes to this ticket

  • Simon Chiu

    Simon Chiu April 28th, 2009 @ 01:49 PM

    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.

  • Andrew France

    Andrew France June 11th, 2009 @ 07:04 PM

    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.)
  • Ari Epstein

    Ari Epstein November 7th, 2009 @ 03:02 PM

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


    {mkd-extraction-ad9d79ea10d3bb971dfb385a3ee01617}

    To:


    {mkd-extraction-6f8ad3a4d7c861170ca64e9dd6eb63ea}
  • Rizwan Reza

    Rizwan Reza January 20th, 2010 @ 10:10 AM

    • State changed from “new” to “invalid”

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>

Referenced by

Pages