Forum: Ruby on Rails Odd deprecation warnings...

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.
8a06d940b20d983af0e6500f865b5e54?d=identicon&s=25 Eric Nielsen (Guest)
on 2007-01-01 18:26
I have come across a few deprecation warnings that I think are in error
and I'm not sure how to resolve them.

The first set are regarding the "type" column of an STI hierarchy
conficting with Object#type:  The warning message in particular is:

/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.5.5618/lib/action_view/helpers/form_helper.rb:349:
warning: Object#type is deprecated; use Object#class

and is triggered from calling

  <%= f.radio_button :type, "Personal" -%>
  <%= f.radio_button :type, "Shared" -%>

within a form_for block with an instance of the base class of the STI
hierarchy bound to the model variable.  (This is step one in a two step
wizard for creating accounts.  In step two the display is customized
with the appropriate fieds based on the type selected in step one.)


The second set of warnings deal with "find_all" when used with a block
as a filter over a collection.  I'm not trying to use the find_all =>
find :all finder.  I need to generate a list of all elements in the
collection that meet a rather complicated set of condiftions that's
calculated in the model (doesn't hit the DB).  Is there a way to call
the underlying find_all with a block on an enumerable collection of AR
objects without triggering the find_all=>find :all deprecation warning?

Thank you.
Eric
C64e63b70be7dfed8b0742540b8b27e5?d=identicon&s=25 Mark Reginald James (Guest)
on 2007-01-03 06:37
(Received via mailing list)
Eric Nielsen wrote:

> and is triggered from calling
>
>  <%= f.radio_button :type, "Personal" -%>
>  <%= f.radio_button :type, "Shared" -%>
>
> within a form_for block with an instance of the base class of the STI
> hierarchy bound to the model variable.  (This is step one in a two step
> wizard for creating accounts.  In step two the display is customized
> with the appropriate fieds based on the type selected in step one.)

http://article.gmane.org/gmane.comp.lang.ruby.rails/84823

> The second set of warnings deal with "find_all" when used with a block
> as a filter over a collection.  I'm not trying to use the find_all =>
> find :all finder.  I need to generate a list of all elements in the
> collection that meet a rather complicated set of condiftions that's
> calculated in the model (doesn't hit the DB).  Is there a way to call
> the underlying find_all with a block on an enumerable collection of AR
> objects without triggering the find_all=>find :all deprecation warning?

http://article.gmane.org/gmane.comp.lang.ruby.rails/100514

--
We develop, watch us RoR, in numbers too big to ignore.
This topic is locked and can not be replied to.