从SQLite

时间:2018-02-21 04:58:35

标签: ruby-on-rails postgresql sqlite

我想在heroku中将我的rails项目从dev推送到生产,我只是意识到heroku正在使用Postgre而不是SQLite,我有一个错误,我仍然无法解决,尽管我看过类似的的问题。

我有这个查询,其中每个joggings都有很多属性,但我只想要使用location_id和created_at的joggings,其location_id是不同的或不是多余的,这个查询工作正常,结果只显示joings,其中location_id只显示一次,但是它在Postgre中的错误。

joggings = @current_user.joggings.where(together: true).select(:location_id, :created_at).group(:location_id)

你知道如何解决这个问题吗?非常感谢你

0 个答案:

没有答案
相关问题