# Problem with acts\_as\_versioned

**URL:** <https://www.ruby-forum.com/t/problem-with-acts-as-versioned/171492>\
**Category:** Rails\
**Created:** [July 3, 2009, 2:45pm UTC](https://www.ruby-forum.com/t/problem-with-acts-as-versioned/171492 "2009-07-03T14:45:31Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![rafaelrosafu](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/59ef9b/32.png) [@rafaelrosafu](https://www.ruby-forum.com/u/rafaelrosafu)\
**Post date:** [July 3, 2009, 2:45pm UTC](https://www.ruby-forum.com/t/problem-with-acts-as-versioned/171492/1 "2009-07-03T14:45:31Z")

</div>

Hi all,  
I get the following error when trying to use acts\_as\_versioned plugin:

uninitialized constant  
ActiveRecord::Acts::Versioned::ClassMethods::Inflector

How can I solve this?  
Thanks,  
Rafael R.

---

<div class="post-metadata">

**Author:** ![rafaelrosafu](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/59ef9b/32.png) [@rafaelrosafu](https://www.ruby-forum.com/u/rafaelrosafu)\
**Post date:** [July 3, 2009, 2:49pm UTC](https://www.ruby-forum.com/t/problem-with-acts-as-versioned/171492/2 "2009-07-03T14:49:27Z")

</div>

The name of the class is ActiveSupport::Inflector now, you’ll have to  
change the reference on the plugin.

- 

Maurício Linhares  
[http://codeshooter.wordpress.com/](http://codeshooter.wordpress.com/) | [http://twitter.com/mauriciojr](http://twitter.com/mauriciojr)

On Fri, Jul 3, 2009 at 9:45 AM, Rafael

---

<div class="post-metadata">

**Author:** ![rafaelrosafu](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/59ef9b/32.png) [@rafaelrosafu](https://www.ruby-forum.com/u/rafaelrosafu)\
**Post date:** [July 3, 2009, 2:54pm UTC](https://www.ruby-forum.com/t/problem-with-acts-as-versioned/171492/3 "2009-07-03T14:54:07Z")

</div>

MaurÃ­cio Linhares wrote:

> The name of the class is ActiveSupport::Inflector now, you’ll have to  
> change the reference on the plugin.
> 
> - 
> 
> Maurï¿½cio Linhares  
> [http://codeshooter.wordpress.com/](http://codeshooter.wordpress.com/) | [http://twitter.com/mauriciojr](http://twitter.com/mauriciojr)
> 
> On Fri, Jul 3, 2009 at 9:45 AM, Rafael

Mauricio,  
what do you mean by “reference on the plugin”?

---

<div class="post-metadata">

**Author:** ![rafaelrosafu](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/59ef9b/32.png) [@rafaelrosafu](https://www.ruby-forum.com/u/rafaelrosafu)\
**Post date:** [July 3, 2009, 2:57pm UTC](https://www.ruby-forum.com/t/problem-with-acts-as-versioned/171492/4 "2009-07-03T14:57:03Z")

</div>

Get inside the plugin code, look for where Inflector is being used and  
change it to ActiveSupport::Inflector.

- 

MaurÃ­cio Linhares  
[http://codeshooter.wordpress.com/](http://codeshooter.wordpress.com/) | [http://twitter.com/mauriciojr](http://twitter.com/mauriciojr)

On Fri, Jul 3, 2009 at 9:54 AM, Rafael

---

<div class="post-metadata">

**Author:** ![rafaelrosafu](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/59ef9b/32.png) [@rafaelrosafu](https://www.ruby-forum.com/u/rafaelrosafu)\
**Post date:** [July 3, 2009, 3:30pm UTC](https://www.ruby-forum.com/t/problem-with-acts-as-versioned/171492/5 "2009-07-03T15:30:04Z")

</div>

Andrew T. wrote:

> 2009/7/3 Maurï¿½cio Linhares [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid):
> 
> > Get inside the plugin code, look for where Inflector is being used and  
> > change it to ActiveSupport::Inflector.
> 
> First check that the plugin doesn’t have a more recent version.  
> I’m using it in a Rails 2.3.2 project fine (but I can’t remember if I  
> patched it myself or not)
> 
> Andrew T.  
> [http://ramblingsonrails.com](http://ramblingsonrails.com)
> 
> [http://MyMvelope.com](http://MyMvelope.com) - The SIMPLE way to manage your savings

Hi Andrew,  
IÂ´m using Rails 2.2.2 and acts\_as\_versioned 0.2.3

---

<div class="post-metadata">

**Author:** ![rafaelrosafu](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/59ef9b/32.png) [@rafaelrosafu](https://www.ruby-forum.com/u/rafaelrosafu)\
**Post date:** [July 3, 2009, 3:35pm UTC](https://www.ruby-forum.com/t/problem-with-acts-as-versioned/171492/6 "2009-07-03T15:35:02Z")

</div>

Browsing through the acts\_as\_versioned.rb file I found the following:

self.versioned\_table\_name = options[:table\_name] ||  
“#{table\_name\_prefix}#{Inflector.underscore(Inflector.demodulize(class\_name\_of\_active\_record\_descendant(self)))}\_versions#{table\_name\_suffix}”

Is it what I must change?

---

<div class="post-metadata">

**Author:** ![rafaelrosafu](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/59ef9b/32.png) [@rafaelrosafu](https://www.ruby-forum.com/u/rafaelrosafu)\
**Post date:** [July 3, 2009, 3:43pm UTC](https://www.ruby-forum.com/t/problem-with-acts-as-versioned/171492/7 "2009-07-03T15:43:51Z")

</div>

Damn it.It worked!! 🙂

Thanks Mauricio and Andrew.

---

<div class="post-metadata">

**Author:** ![rafaelrosafu](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/59ef9b/32.png) [@rafaelrosafu](https://www.ruby-forum.com/u/rafaelrosafu)\
**Post date:** [July 3, 2009, 3:15pm UTC](https://www.ruby-forum.com/t/problem-with-acts-as-versioned/171492/8 "2009-07-03T15:15:45Z")

</div>

2009/7/3 Maurício Linhares [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid):

> Get inside the plugin code, look for where Inflector is being used and  
> change it to ActiveSupport::Inflector.

First check that the plugin doesn’t have a more recent version.  
I’m using it in a Rails 2.3.2 project fine (but I can’t remember if I  
patched it myself or not)

Andrew T.  
[http://ramblingsonrails.com](http://ramblingsonrails.com)

[http://MyMvelope.com](http://MyMvelope.com) - The SIMPLE way to manage your savings

---

<div class="post-metadata">

**Author:** ![rafaelrosafu](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/59ef9b/32.png) [@rafaelrosafu](https://www.ruby-forum.com/u/rafaelrosafu)\
**Post date:** [July 3, 2009, 3:44pm UTC](https://www.ruby-forum.com/t/problem-with-acts-as-versioned/171492/9 "2009-07-03T15:44:25Z")

</div>

On Fri, Jul 3, 2009 at 3:35 PM, Rafael  
Roque[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Browsing through the acts\_as\_versioned.rb file I found the following:
> 
> self.versioned\_table\_name = options[:table\_name] ||  
> “#{table\_name\_prefix}#{Inflector.underscore(Inflector.demodulize(class\_name\_of\_active\_record\_descendant(self)))}\_versions#{table\_name\_suffix}”
> 
> Is it what I must change?

That same line in my version is:  
self.versioned\_table\_name = options[:table\_name] ||  
“#{table\_name\_prefix}#{base\_class.name.demodulize.underscore}\_versions#{table\_name\_suffix}”

I think you are using an old version and should upgrade

> **[GitHub - technoweenie/acts\_as\_versioned: ActiveRecord plugin for versioning...](https://github.com/technoweenie/acts_as_versioned)**
>
> ActiveRecord plugin for versioning your models. Contribute to technoweenie/acts\_as\_versioned development by creating an account on GitHub.

Andrew T.  
[http://ramblingsonrails.com](http://ramblingsonrails.com)

[http://MyMvelope.com](http://MyMvelope.com) - The SIMPLE way to manage your savings
