1
어떻게 10 진수 또는 날짜 필드로 주문합니까?t.date 또는 t.decimal 필드 인 경우 order_by를 사용하는 방법은 무엇입니까?
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
어떤 모델에 간다?