foreign key support

22 views
Skip to first unread message

SimonS

unread,
May 25, 2012, 3:46:39 PM5/25/12
to RGeo-Users
Hi

Don't suppose you know of any gem's that provide foreign key
functionality in active record migration that are compatible with
activerecord-postgis-adapter.

I've been using foreigner...but ths seem incompatible with this
adapter.
https://github.com/matthuhiggins/foreigner

Thanks
-Simon

Chris Davaz

unread,
Oct 28, 2014, 7:57:48 PM10/28/14
to rgeo-...@googlegroups.com
I know this post is ancient, but just to document my own solution:

require 'sinatra/activerecord'
require 'rgeo-activerecord'
require 'foreigner'

Foreigner::Adapter.register 'postgis', 'foreigner/connection_adapters/postgresql_adapter'

ActiveSupport.on_load :active_record do
    Foreigner.load
end

I put this in config/active_record.rb in my project and load it at startup.
Reply all
Reply to author
Forward
0 new messages