Forum: Ruby on Rails FCGI: warning: Object#id will be deprecated; use Object#obje

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
A7db9ec803b5895ae5f916a74e2db329?d=identicon&s=25 Hunter's Lists (Guest)
on 2005-12-28 17:44
(Received via mailing list)
I am seeing some strange entries in my Apache error log from FCGI that I
don't understand.

I have pasted one of the lines below.

Anyone seen this or know what might be going on?

[Wed Dec 28 08:35:50 2005] [error] [client 24.115.131.100] FastCGI:
server
"/home/www/apps/appname/public/dispatch.fcgi" stderr:
/home/www/apps/appname/app/views/photo/fullsize.rhtml:26: warning:
Object#id
will be deprecated; use Object#object_id, referer:
http://www.mydomain.com/photo/fullsize/142

There are literally hundreds of thousands of these lines (400MB worth).

Thanks.
417e50c1bb8f3958b58e9b1f593a9e0b?d=identicon&s=25 Shawn Garbett (Guest)
on 2005-12-28 18:24
(Received via mailing list)
--- Hunter's Lists <lists@lastonepicked.com> wrote:
> "/home/www/apps/appname/public/dispatch.fcgi"
> stderr:
>
/home/www/apps/appname/app/views/photo/fullsize.rhtml:26:
> warning: Object#id
> will be deprecated; use Object#object_id, referer:
> http://www.mydomain.com/photo/fullsize/142
>
> There are literally hundreds of thousands of these
> lines (400MB worth).

There is an unfortunate name space collision, that is
being mitgated by transitioning to object_id. This
will eventually be fixed I understand, but it takes
time to get it right.

The following code in environment.rb will make it go
away, but USE AT YOUR OWN RISK. This is risky code,
and I haven't been able to figure out why it works,
but it does for us. If you have plenty of test
coverage, it shouldn't be a problem. We have several
patches like this in a single file that is referenced
from environment.rb

# patching object_id deprecation warnings
STDERR << "Patching object_id deprecation warnings\n"
module ActionView
  module Helpers
    class InstanceTag
      def value
        object.send(@method_name == 'id' ? 'object_id'
: @method_name) unless object.nil?
      end
    end
  end
end

Shawn



__________________________________________
Yahoo! DSL ? Something to write home about.
Just $16.99/mo. or less.
dsl.yahoo.com
This topic is locked and can not be replied to.