小编Mar*_*res的帖子

ActiveRecord中的自定义数据库类型

我正在使用Rails 3.1.1和PostgreSQL 9.1以及地球距离模块.为了能够正确计算不同位置之间的距离,我earthbranches表格中设置了一个类型的列.

我现在遇到的问题是我的Rails应用程序使用此表不理解地球类型,因此我得到了这个db/schema.rb:

# Could not dump table "branches" because of following StandardError
#   Unknown type 'earth' for column 'location'

这是有问题的,因为现在我无法从schema.rb创建我的测试数据库.

如何将此类型添加到AR或使其忽略该列?

activerecord ruby-on-rails earthdistance

11
推荐指数
2
解决办法
2795
查看次数