我有一个模型,地理定位工作正常,分页(通过限制/偏移)像kaminari和will_paginate,工作正常。分别。然而,他们一起向我提出了这个错误。
Location.near(postcode, 5) # works fine
Location.all.page(1) # works fine
Location.near(postcode, 5).page(1) #gives me the following error...
PG::UndefinedColumn: ERROR: column "distance" does not exist
有什么想法吗?提前致谢