Problem with acts_as_versioned

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.

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://twitter.com/mauriciojr

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

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://twitter.com/mauriciojr

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

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

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://twitter.com/mauriciojr

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

Andrew T. wrote:

2009/7/3 Maur�cio Linhares [email protected]:

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://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

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?

Damn it.It worked!! :slight_smile:

Thanks Mauricio and Andrew.

2009/7/3 Maurício Linhares [email protected]:

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://MyMvelope.com - The SIMPLE way to manage your savings

On Fri, Jul 3, 2009 at 3:35 PM, Rafael
Roque[email protected] 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

Andrew T.
http://ramblingsonrails.com

http://MyMvelope.com - The SIMPLE way to manage your savings