您如何按小数或日期字段排序?
class CreateUserPrices < ActiveRecord::Migration
def self.up
create_table :user_prices do |t|
t.decimal :price, :precision => 8, :scale => 2
t.date :purchase_date
t.timestamps
end
end
end
我正在尝试按价格和购买日期对我的用户价格进行排序。
searchable do
text :product_name do
product.name
end
# field for :price?
# field for :purchase_date?
end
模型中有什么?