0

我想在 Rails 中使用 Geokit 计算距离并使用within子句。但是,当我在子句中输入列名时,出现以下错误:

NoMethodError:未定义的方法“to_f”:距离:符号

mobility_request = Mobility.within(:distance, :origin =>[self.location.latitude,self.location.longitude]).includes(:location)

如何正确使用 :distance 符号?

4

0 回答 0