0

很简单的一个。

我想做以下

Model.where("money_rate > ?", some_other_money_item)

有任何想法吗?

PG::UndefinedColumn: ERROR:  column "money_rate" does not exist
LINE 1: SELECT "jobs".* FROM "jobs"  WHERE (money_rate > '--- !ruby/...etc
4

1 回答 1

0

似乎您只能使用基本方法进行比较,在上述情况下,这将是 money_rate_cents

所以:

Model.where("money_rate_cents > ?", some_other_money_item_in_cents)

返回货币属性较高的项目数组。

将留下它以防其他人发现它有用。或者,如果我遗漏了什么,您可以对整个数字进行比较。

于 2015-08-21T16:02:15.150 回答