0

これは、「プロパティ」テーブルのレコードのハッシュの例です。問題の属性は「所有者」です。

Property.first #=>
  #<Property id: 3684, ss_property_id: 1, owner_full_name: "Holliday Associates", owner: "HA",
  owners_pctg: 100, tax_map_id: "0460001047", county: "Horry", description: "L.S. Alford", acreage:
  131.0, prop_taxes_2009: 180.72, prop_taxes_2010: 173.99, prop_taxes_2011: 172.94, notes: nil,
  created_at: "2013-04-03 01:16:23", updated_at: "2013-04-03 01:16:26">

しかし、私がこのようなことをするとき

1.9.3p194 :011 > Property.first.owner
Property Load (0.3ms)  SELECT "properties".* FROM "properties" LIMIT 1
=> nil

それはゼロです。

編集:ここに私のモデルがあります(劇的に単純化されすぎています...)

class Property < ActiveRecord::Base
  belongs_to :owner
end
4

1 に答える 1