has_one :through issue


I'd like to hear your opinions about the following issue.

I set up associations like this:
class User
  has_one :user_info
  has_many :bank_infos

class UserInfo
  belongs_to :user

class BankInfo
  belongs_to :user
  has_one :user_info, :through => :user

Then given a user with user_info present I build a bank_info:
bank_info = user.bank_infos.build

and I expect bank_info.user_info to equal bank_info.user.user_info,
however I get nil. The reason I get nil is the condition for loading
associated object in method load_target:
in line 236

Do you think its reasonable to make bank_info.user_info to load the
associated object in the case described above?

It seems reasonable to me. Can you file a ticket in lighthouse and
assign it to me?


I have created a ticket on lighthouse before, and even assigned a
patch. Well, I'm not sure if this patch is correct, or it should work
some other way. Take a look please:

So, is anybody going to do something with that? :slight_smile:

I will get to it. I have a lot on my plate, but it will happen. :slight_smile: