dazuma/rgeo-activerecord — Issue #5: Error on AR Base#inspect in Rails 3.2.x
Author: quartzmo
Created: 2012-02-02 19:35:47+00:00
State: open

*I get this error consistently with all instances loaded from the database with postgis types:*

1.9.2-p290 :011 > c = c.reload
(0.7ms) SELECT * FROM geometry_columns WHERE f_table_name='custom_regions'
CustomRegion Load (0.4ms) SELECT "custom_regions".* FROM "custom_regions" WHERE "custom_regions"."id" = $1 LIMIT 1 [["id", 36]]
(Object doesn't support #inspect)
=>
1.9.2-p290 :012 > c.inspect
NoMethodError: undefined method `rgeo_factory_settings' for Module:Class
from /Users/vitalvu/.rvm/gems/ruby-1.9.2-p290@mapping_update/gems/activerecord-3.2.1/lib/active_record/attribute_methods/read.rb:82:in `__temp__'
from /Users/vitalvu/.rvm/gems/ruby-1.9.2-p290@mapping_update/gems/activerecord-3.2.1/lib/active_record/attribute_methods/read.rb:46:in `type_cast_attribute'
from /Users/vitalvu/.rvm/gems/ruby-1.9.2-p290@mapping_update/gems/activerecord-3.2.1/lib/active_record/attribute_methods/read.rb:126:in `read_attribute'
from /Users/vitalvu/.rvm/gems/ruby-1.9.2-p290@mapping_update/gems/activerecord-3.2.1/lib/active_record/attribute_methods.rb:178:in `attribute_for_inspect'
from /Users/vitalvu/.rvm/gems/ruby-1.9.2-p290@mapping_update/gems/activerecord-3.2.1/lib/active_record/base.rb:638:in `block in inspect'
from /Users/vitalvu/.rvm/gems/ruby-1.9.2-p290@mapping_update/gems/activerecord-3.2.1/lib/active_record/base.rb:636:in `collect'
from /Users/vitalvu/.rvm/gems/ruby-1.9.2-p290@mapping_update/gems/activerecord-3.2.1/lib/active_record/base.rb:636:in `inspect'
from (irb):12
from /Users/vitalvu/.rvm/gems/ruby-1.9.2-p290@mapping_update/gems/railties-3.2.1/lib/rails/commands/console.rb:47:in `start'
from /Users/vitalvu/.rvm/gems/ruby-1.9.2-p290@mapping_update/gems/railties-3.2.1/lib/rails/commands/console.rb:8:in `start'
from /Users/vitalvu/.rvm/gems/ruby-1.9.2-p290@mapping_update/gems/railties-3.2.1/lib/rails/commands.rb:41:in `'
from script/rails:6:in `require'
from script/rails:6:in `

'

*Note that I am able to retrieve the postgis values however:*

1.9.2-p290 :002 > c1.polygon
=> #

Here are my relevant gems:

* activerecord (3.2.1)
* activerecord-postgis-adapter (0.4.0)
* activeresource (3.2.1)
* activesupport (3.2.1)
* archive-tar-minitar (0.5.2)
* arel (3.0.0)
...
* pg (0.12.2)
...
* rgeo (0.3.3)
* rgeo-activerecord (0.4.2)