EB
Size: a a a
EB
EB
D
EB
NM
NM
NM
EB
RV
EB
AD
IZ
D
NF
.order('prices.created_at'), то всплываетSELECT DISTINCT ON expressions must match initial ORDER BY expressionsNF
distinct on и отсутвие order by намекает что он тебе не очень то и нуженDISTINCTreload!;Item.with_actual_price(1).to_a.size => 29reload!;Item.with_actual_price(1).to_a.size => 31create_table "items", force: :cascade do |t|
t.integer "search_id", null: false
t.string "title"
t.string "url"
t.string "product_id"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.string "source"
t.index ["product_id"], name: "index_items_on_product_id", unique: true
end
create_table "prices", force: :cascade do |t|
t.integer "item_id", null: false
t.integer "value"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.index ["item_id"], name: "index_prices_on_item_id"
end
И
DISTINCTreload!;Item.with_actual_price(1).to_a.size => 29reload!;Item.with_actual_price(1).to_a.size => 31create_table "items", force: :cascade do |t|
t.integer "search_id", null: false
t.string "title"
t.string "url"
t.string "product_id"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.string "source"
t.index ["product_id"], name: "index_items_on_product_id", unique: true
end
create_table "prices", force: :cascade do |t|
t.integer "item_id", null: false
t.integer "value"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.index ["item_id"], name: "index_prices_on_item_id"
end
NF
И
NF