CCH
2007-Oct-18 02:26 UTC
Rails 1.2.5 - : warning: Object#type is deprecated; use Object#class
Hi After updating to 1.2.5, I am getting : warning: Object#type is deprecated; use Object#class for this code snippet AuditTrail.create(:record_id => record.id, :record_type => record.type.name, :event => event, :user_id =>user, :name=>username) Which part of the the above-mentioned code should I change in order to remove the deprecation warning ? --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
CCH
2007-Oct-18 04:00 UTC
Re: Rails 1.2.5 - : warning: Object#type is deprecated; use Object#class
Hi Have isolated deprecation to :- :record_type => record.type.name, How to make this into Object#class syntax ? On Oct 18, 10:26 am, CCH <c...-Z/Eug3sLCsSPzdAsCNHSEg@public.gmane.org> wrote:> Hi > > After updating to 1.2.5, I am getting > : warning: Object#type is deprecated; use Object#class for this code > snippet > > AuditTrail.create(:record_id => record.id, :record_type => > record.type.name, > :event => event, :user_id > =>user, :name=>username) > > Which part of the the above-mentioned code should I change in order to > remove the deprecation warning ?--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
William Pratt
2007-Oct-18 04:20 UTC
Re: Rails 1.2.5 - : warning: Object#type is deprecated; use Object#class
You can do record.class. This returns a string representation of the class. -Bill CCH wrote:> Hi > > Have isolated deprecation to :- > > :record_type => record.type.name, > > How to make this into Object#class syntax ? > > > On Oct 18, 10:26 am, CCH <c...-Z/Eug3sLCsSPzdAsCNHSEg@public.gmane.org> wrote: > >> Hi >> >> After updating to 1.2.5, I am getting >> : warning: Object#type is deprecated; use Object#class for this code >> snippet >> >> AuditTrail.create(:record_id => record.id, :record_type => >> record.type.name, >> :event => event, :user_id >> =>user, :name=>username) >> >> Which part of the the above-mentioned code should I change in order to >> remove the deprecation warning ? >> > > > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Anthony Richardson
2007-Oct-18 04:21 UTC
Re: Rails 1.2.5 - : warning: Object#type is deprecated; use Object#class
CCH wrote:> Hi > > Have isolated deprecation to :- > > :record_type => record.type.name, > > How to make this into Object#class syntax ? > >Just changing to class instead of type should work, according to the Ruby docs Object#type is a deprecated synonym for Object#class :record_type => record.class.name, http://www.ruby-doc.org/core/classes/Object.html#M000347 --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
CCH
2007-Oct-18 04:39 UTC
Re: Rails 1.2.5 - : warning: Object#type is deprecated; use Object#class
Hi Anthony> How to make this into Object#class syntax ? > > Just changing to class instead of type should work, according to the > Ruby docs Object#type is a deprecated synonym for Object#class > > :record_type => record.class.name,cch: This works ! Thanx to you and also Bill Pratt ! --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---