Forum: Ruby on Rails problem with acts_as_versioned

Posted by Rafael Roque (rafaelroque)
on 2009-07-03 14:45
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 Roque
Posted by Maurício Linhares (mauricio)
on 2009-07-03 14:49
(Received via mailing list)
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
Posted by Rafael Roque (rafaelroque)
on 2009-07-03 14:54
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"?
Posted by Maurício Linhares (mauricio)
on 2009-07-03 14:57
(Received via mailing list)
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
Posted by Andrew Timberlake (andrewtimberlake)
on 2009-07-03 15:15
(Received via mailing list)
2009/7/3 Maurício Linhares <mauricio.linhares@gmail.com>:
>
> 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 Timberlake
http://ramblingsonrails.com

http://MyMvelope.com - The SIMPLE way to manage your savings
Posted by Rafael Roque (rafaelroque)
on 2009-07-03 15:30
Andrew Timberlake wrote:
> 2009/7/3 Maur�cio Linhares <mauricio.linhares@gmail.com>:
>>
>> 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 Timberlake
> 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

Posted by Rafael Roque (rafaelroque)
on 2009-07-03 15:35
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?
Posted by Rafael Roque (rafaelroque)
on 2009-07-03 15:43
Damn it.It worked!! :)

Thanks Mauricio and Andrew.
Posted by Andrew Timberlake (andrewtimberlake)
on 2009-07-03 15:44
(Received via mailing list)
On Fri, Jul 3, 2009 at 3:35 PM, Rafael
Roque<rails-mailing-list@andreas-s.net> 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
http://github.com/technoweenie/acts_as_versioned

Andrew Timberlake
http://ramblingsonrails.com

http://MyMvelope.com - The SIMPLE way to manage your savings
Please log in before posting. Registration is free and takes only a minute.
Existing account (Switch to SSL-encrypted connection)
NEW: Do you have a Google/GoogleMail or Yahoo account? No registration required!
Log in with Google account | Log in with Yahoo account
No account? Register here.