This project is archived and is in readonly mode.

#6383 new
Gavin Brock

NoMethodError: undefined method `money_precision=' for #<Class:0x0000010321f788>

Reported by Gavin Brock | February 7th, 2011 @ 01:06 AM

This is a fix for the invalid ticket: #5081

I also encountered this error, but only after installing the acts-as-tesearch plugin (http://code.google.com/p/acts-as-tsearch/) on OS-X.

$ rails c
Loading development environment (Rails 3.0.3)
ruby-1.9.2-p0 :001 > Content.all
NoMethodError: undefined method `money_precision=' for #<Class:0x00000102af3018>
    from /Users/gavin/.rvm/gems/ruby-1.9.2-p0@HEAD/gems/activerecord-3.0.3/lib/active_record/connection_adapters/postgresql_adapter.rb:937:in `connect'
    from /Users/gavin/.rvm/gems/ruby-1.9.2-p0@HEAD/gems/activerecord-3.0.3/lib/active_record/connection_adapters/postgresql_adapter.rb:228:in `initialize'
    from /Users/gavin/.rvm/gems/ruby-1.9.2-p0@HEAD/gems/activerecord-3.0.3/lib/active_record/connection_adapters/postgresql_adapter.rb:25:in `new'

I could fix this by changing line 937:

PostgreSQLColumn.money_precision = (postgresql_version >= 80300) ? 19 : 10

to

ActiveRecord::ConnectionAdapters::PostgreSQLColumn.money_precision = (postgresql_version >= 80300) ? 19 : 10

From what I could tell, this is because in the context, class PostgreSQLColumn is interpreted as a ActiveRecord::ConnectionAdapters::PostgreSQLAdapter::PostgreSQLColumn which as far as I can see is undeclared.

.. Gavin

Comments and changes to this ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

Tickets have moved to Github

The new ticket tracker is available at https://github.com/rails/rails/issues

Shared Ticket Bins

People watching this ticket

Referenced by

Pages