Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

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

#6383

This is a fix for the invalid ticket: #5081 undefined method `money_precision=' for #<Class:0x105d7dda8> in postgresql_ad...

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

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

State: new
Milestone: none
Assigned to: nobody
Importance: none