我收到一个模型而不是另一个模型发生的错误。我可以运行Job.all.within(5, :origin => [0, 0])
,但不能运行,User.all.within(5, :origin => [0, 0])
即使他们的模型中有相同的信息:acts_as_mappable lng_column_name: :longitude, lat_column_name: :latitude
对于损坏的情况,它似乎在这里中断(这是来自 Geokit gem 的代码):
def within(distance, options = {})
options[:within] = distance
#geo_scope(options)
where(distance_conditions(options)) # HERE
end
如果我打断,我可以在哪里输出:
>> options
=> {:within=>5}
>> distance_conditions(options)
!! #<TypeError: no implicit conversion of Symbol into Integer>
这是怎么回事?