使用 geokit-rails gem,我有:
Employer.rb
模型,具有 lng 和 lat 属性:
has_many :jobs,dependent: :destroy act_as_mappable
Job.rb
模型,没有 lng 或 lat
act_as_mappable :through => :employer
如果我Job.within(3, origin: [0, 0])
在控制台中尝试,我会收到此错误:
PG::UndefinedTable: ERROR: missing FROM-clause entry for table "employers"
LINE 2: ... (ACOS(least(1,COS(0.0)*COS(0.0)*COS(RADIANS(employers....