Jason Fox
2008-Jun-18 04:36 UTC
Possible Rails 2.1.0 issue using the Object''s send method
Code like the following worked fine under Rails 2.0.2 but now throws an exception under Rails 2.1.0. Has anyone else had this issue? class BugTest < ActiveRecord::Base def set_name(value) send("name=", value) end end Here''s the exception... NoMethodError: You have a nil object when you didn''t expect it! You might have expected an instance of Array. The error occurred while evaluating nil.include? /vendor/rails/activerecord/lib/active_record/dirty.rb:126:in `write_attribute'' -- 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 -~----------~----~----~----~------~----~------~--~---
horsfallp-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org
2008-Jul-24 08:39 UTC
Re: Possible Rails 2.1.0 issue using the Object''s send method
I came across this upgrading a site to Rails 2.1. In my case it was attribute change tracking stuff in Rails not playing nicely with the acts_as_versioned plugin which does something similar. The latest version of the plugin sort this, grab it with something like "script/ plugin install git://github.com/technoweenie/acts_as_versioned.git". --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
horsfallp-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org
2008-Jul-24 10:24 UTC
Re: Possible Rails 2.1.0 issue using the Object''s send method
I came across this upgrading a site to Rails 2.1. In my case it was attribute change tracking stuff in Rails not playing nicely with the acts_as_versioned plugin which does something similar. The latest version of the plugin sort this, grab it with something like "script/ plugin install git://github.com/technoweenie/acts_as_versioned.git". --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
horsfallp-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org
2008-Jul-24 11:21 UTC
Re: Possible Rails 2.1.0 issue using the Object''s send method
I came across this upgrading a site to Rails 2.1. In my case it was the attribute change tracking stuff in Rails not playing nicely with the acts_as_versioned plugin, which does something similar. The latest version of the plugin sorts this, grab it with something like "script/ plugin install git://github.com/technoweenie/acts_as_versioned.git". --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
horsfallp-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org
2008-Jul-24 17:09 UTC
Re: Possible Rails 2.1.0 issue using the Object''s send method
I think acts_as_versioned was extending ActiveRecord with its own changed_attributes collection. I was hoping you''d be using the plugin, but if not then yeah, I guess you could jump in the code. On 24 Jul, 18:00, Jason Fox <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> horsfa...-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org wrote: > > I came across this upgrading a site to Rails 2.1. In my case it was > > the attribute change tracking stuff in Rails not playing nicely with > > the acts_as_versioned plugin, which does something similar. The latest > > version of the plugin sorts this, grab it with something like "script/ > > plugin install git://github.com/technoweenie/acts_as_versioned.git". > > Do you know how this problem was solved or shall I dive into the > acts_as_versioned code? > > - Jason > > -- > 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 -~----------~----~----~----~------~----~------~--~---