0

So I'm running rgeo with activerecord-postgis-adapter and have a Rails 4 app's db.yml file set up correctly.

But when I set the attributes of a ActiveRecord model like:

Place
 .create(name: 'some name', geom: RGeo::Geographic.spherical_factory(:srid => 4326)
 .point(latitude,longitude)

And then check the SQL INSERT statement it fires, it won't include geom in the INSERT INSERT INTO "places" ("name", "some_attr"..... <- no geom attr being inserted.

If anyone has seen this before and has an idea to what the problem might be, please help thanks!

aBadAssCowboy
  • 2,440
  • 2
  • 23
  • 38
Keith Johnson
  • 730
  • 2
  • 9
  • 19
  • Are you sure `RGeo::Geographic.spherical_factory(:srid => 4326)` returns some value? – aBadAssCowboy Jul 25 '16 at 20:37
  • Yup! A point object is assigned as the attributes value. When I re-query the record using `.find(id)` it's no longer there because that attribute wasn't part of the `create's` SQL INSERT – Keith Johnson Jul 25 '16 at 21:35

0 Answers0