1
我試圖把所有的訂單從數據庫中兩個特定的客戶端,一切我嘗試在軌C給出我一個錯誤:嘗試查詢軌數據庫
irb(main):008:0> clients = clients.find(name: "CLS_Trials")
NoMethodError: undefined method `find' for nil:NilClass
我的架構是這樣的
create_table "clients", force: true do |t|
t.string "name"
t.datetime "created_at"
t.datetime "updated_at"
t.string "sku_part"
t.float "postage_account"
t.boolean "accrue_fees"
t.float "pick_pack_per_unit"
t.string "logo_file_name"
t.string "logo_content_type"
t.integer "logo_file_size"
t.datetime "logo_updated_at"
t.string "slug"
t.boolean "sub_admin"
t.boolean "static_shipping"
t.float "static_shipping_amount"
t.datetime "invoice_stop"
t.string "street_address"
t.string "city"
t.string "state"
t.string "zip"
t.string "primary_contact_name"
t.float "min_postage"
t.float "postage_threshold"
t.integer "pageviews_today"
t.integer "pageviews_yesterday"
t.boolean "using_analytics"
t.string "sites", default: [], array: true
t.integer "weather_degrees"
t.string "weather_status"
t.float "other_fees"
t.string "lime_light_user_name"
t.string "lime_light_password"
t.boolean "using_lime_light"
end
我知道數據在那裏,關於如何正確拉取我的客戶的所有訂單並將數據導出到文本文件或exel的任何建議?謝謝你們!
非常感謝!所以現在要從客戶端拉出所有的訂單,我所要做的就是這樣, – ZachyBear
orders = Orders.all(external_Id:tracking :) – ZachyBear