Когда я вызываю свою первую модель в консоли:
Lead.first
, я получаю правильный результат:
Lead Load (1.2ms) SELECT "leads".* FROM "leads" ORDER BY "leads"."id" ASC LIMIT ? [["LIMIT", 1]]
=> #<Lead id: 2070, company: "Schobertechnologies GmbH", industry: "Tool manufacturer", street: "Industriestraße 2", zip: "71735", city: "Eberdingen", country: "Germany", phone: "+49 7042 7900", website: "http://www.schobertechnologies.de/", linkedin: nil, created_at: "2020-02-19 11:41:20", updated_at: "2020-02-19 11:41:20", customer_id: "bcommand", slug: "schobertechnologiesgmbh">
Другая модель компании
Company.first
показывает
Company Load (0.2ms) SELECT "companies".* FROM "companies" ORDER BY "companies"."id" ASC LIMIT ? [["LIMIT", 1]]
=> #<Company >
В представлении значения для компании отображаются правильно. Это файл схемы.
ActiveRecord::Schema.define(version: 2020_06_15_081229) do
create_table "Companies", force: :cascade do |t|
t.string "company"
t.string "industry"
t.string "street"
t.string "zip"
t.string "city"
t.string "country"
t.string "phone"
t.string "website"
t.string "linkedin"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.string "customer_id"
t.string "slug"
end
create_table "ipblacklists", force: :cascade do |t|
t.string "blacklistedip"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.string "customer_id"
end
create_table "leads", force: :cascade do |t|
t.string "company"
t.string "industry"
t.string "street"
t.string "zip"
t.string "city"
t.string "country"
t.string "phone"
t.string "website"
t.string "linkedin"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.string "customer_id"
t.string "slug"
t.index ["customer_id", "slug"], name: "index_leads_on_customer_id_and_slug"
end
create_table "trackings", force: :cascade do |t|
t.string "ip"
t.string "url"
t.string "customer_id"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
end
create_table "visits", force: :cascade do |t|
t.integer "lead_id"
t.string "url"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.index ["lead_id"], name: "index_visits_on_lead_id"
end
end
Company.first также должна показывать значения объекта? Что здесь происходит?