# Possible Rails 2.1.0 issue using the Object's send method

**URL:** <https://www.ruby-forum.com/t/possible-rails-2-1-0-issue-using-the-objects-send-method/140743>\
**Category:** Rails\
**Created:** [June 18, 2008, 6:36am UTC](https://www.ruby-forum.com/t/possible-rails-2-1-0-issue-using-the-objects-send-method/140743 "2008-06-18T06:36:16Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![jfoxny](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/a6a055/32.png) [@jfoxny](https://www.ruby-forum.com/u/jfoxny)\
**Post date:** [June 18, 2008, 6:36am UTC](https://www.ruby-forum.com/t/possible-rails-2-1-0-issue-using-the-objects-send-method/140743/1 "2008-06-18T06:36:16Z")

</div>

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’

---

<div class="post-metadata">

**Author:** ![jfoxny](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/a6a055/32.png) [@jfoxny](https://www.ruby-forum.com/u/jfoxny)\
**Post date:** [July 24, 2008, 12:35pm UTC](https://www.ruby-forum.com/t/possible-rails-2-1-0-issue-using-the-objects-send-method/140743/2 "2008-07-24T12:35:19Z")

</div>

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”.

---

<div class="post-metadata">

**Author:** ![jfoxny](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/a6a055/32.png) [@jfoxny](https://www.ruby-forum.com/u/jfoxny)\
**Post date:** [July 24, 2008, 12:35pm UTC](https://www.ruby-forum.com/t/possible-rails-2-1-0-issue-using-the-objects-send-method/140743/3 "2008-07-24T12:35:18Z")

</div>

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”.

---

<div class="post-metadata">

**Author:** ![jfoxny](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/a6a055/32.png) [@jfoxny](https://www.ruby-forum.com/u/jfoxny)\
**Post date:** [July 24, 2008, 7:00pm UTC](https://www.ruby-forum.com/t/possible-rails-2-1-0-issue-using-the-objects-send-method/140743/4 "2008-07-24T19:00:49Z")

</div>

removed\_email\_address@domain.invalid 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

---

<div class="post-metadata">

**Author:** ![jfoxny](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/a6a055/32.png) [@jfoxny](https://www.ruby-forum.com/u/jfoxny)\
**Post date:** [July 24, 2008, 8:41pm UTC](https://www.ruby-forum.com/t/possible-rails-2-1-0-issue-using-the-objects-send-method/140743/5 "2008-07-24T20:41:12Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![jfoxny](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/a6a055/32.png) [@jfoxny](https://www.ruby-forum.com/u/jfoxny)\
**Post date:** [July 24, 2008, 5:21pm UTC](https://www.ruby-forum.com/t/possible-rails-2-1-0-issue-using-the-objects-send-method/140743/6 "2008-07-24T17:21:19Z")

</div>

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”.
