In my Mongrel logs, I am getting this: ...active_record/validations.rb:81: warning: Object#type is deprecated; use Object#class That piece of code is: def add_on_blank(attributes, msg = @@default_error_messages[:blank]) for attr in [attributes].flatten value = @base.respond_to?(attr.to_s) ? @base.send(attr.to_s) : @base[attr.to_s] <<< line 81 add(attr, msg) if value.blank? end end I don''t see what Ruby is complaining about. Anyone have any ideas? Thanks, pedz -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
just a guess, but have you given any of your models a "type" field in the database? rails by default will think that your model is using STI if you have a "type" field. On Oct 13, 9:33 am, Perry Smith <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> In my Mongrel logs, I am getting this: > > ...active_record/validations.rb:81: warning: Object#type is deprecated; > use Object#class > > That piece of code is: > > def add_on_blank(attributes, msg = @@default_error_messages[:blank]) > for attr in [attributes].flatten > value = @base.respond_to?(attr.to_s) ? @base.send(attr.to_s) : > @base[attr.to_s] <<< line 81 > add(attr, msg) if value.blank? > end > end > > I don''t see what Ruby is complaining about. Anyone have any ideas? > > Thanks, > pedz > -- > Posted viahttp://www.ruby-forum.com/.--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Jeff Emminger wrote:> just a guess, but have you given any of your models a "type" field in > the database? rails by default will think that your model is using > STI if you have a "type" field. > > > > On Oct 13, 9:33 am, Perry Smith <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org>Thanks but, no... I don''t see just a "type" field. I looked in my migrate files and then I did a rake db:schema:dump and looked in the dump file. I have things like "item_type" but not just "type". I''m using edge rails -- if that matters. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Perry Smith wrote:> Jeff Emminger wrote: >> just a guess, but have you given any of your models a "type" field in >> the database? rails by default will think that your model is using >> STI if you have a "type" field. >> >> >> >> On Oct 13, 9:33 am, Perry Smith <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> > > Thanks but, no... I don''t see just a "type" field. I looked in my > migrate files and then I did a rake db:schema:dump and looked in the > dump file. I have things like "item_type" but not just "type". > > I''m using edge rails -- if that matters.I might have found it. I use to have a field "type" but I changed it. But I goofed and did not change my "validates_presence_of :type". I bet thats it. Thanks. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
aha... you should have caught that in your unit tests ;-) On Oct 13, 7:12 pm, Perry Smith <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> Perry Smith wrote: > > Jeff Emminger wrote: > >> just a guess, but have you given any of your models a "type" field in > >> the database? rails by default will think that your model is using > >> STI if you have a "type" field. > > >> On Oct 13, 9:33 am, Perry Smith <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> > > > Thanks but, no... I don''t see just a "type" field. I looked in my > > migrate files and then I did a rake db:schema:dump and looked in the > > dump file. I have things like "item_type" but not just "type". > > > I''m using edge rails -- if that matters. > > I might have found it. I use to have a field "type" but I changed it. > But I goofed and did not change my "validates_presence_of :type". > > I bet thats it. > > Thanks. > > -- > Posted viahttp://www.ruby-forum.com/.--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---