NoMethodError using activerecord_postgis_adapter

末鹿安然 提交于 2019-12-05 12:14:21

As of version 3.0.0 you can't set column specific geo factory properties. And the method set_rgeo_factory_for_column is removed and deprecated. You can, however configure RGeo factory application wide. For example in your initializer.

RGeo::ActiveRecord::SpatialFactoryStore.instance.tap do |config|
  # By default, use the GEOS implementation for spatial columns.
  config.default = RGeo::Geos.factory_generator

  # But use a geographic implementation for point columns.
  config.register(RGeo::Geographic.spherical_factory(srid: 4326), geo_type: "point")
end
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!