Thanks for the advice. I have tried to check with the reflections, and surely 
enough the relation is there.
So i tried to change the query in the controller to this:

@users = ComUser.find(:first, :include 
=>[:def_jabatan,:def_kelamin,:def_user_role])

and finally the debug shows more attributes, and i can do something like @a = 
@users.def_jabatan.jabatan :D 


Is this the correct way to get the relationship data, that is by adding 
":include" in the search, or is there's more elegant way to do it?



----- Original Message ----
From: Marnen Laibow-Koser <li...@ruby-forum.com>
To: rubyonrails-talk@googlegroups.com
Sent: Tuesday, November 16, 2010 20:51:44
Subject: [Rails] Re: Re: Why is my models can't be related using has_one and 
belongs_to?

arga aridarma wrote in post #961823:
> If debug can't be used for checking relationship, how can I check
> whether the
> relationship is already up and running?

With your automated tests.  reflect_on_association should get you 
started.

(If you don't have comprehensive automated tests, write them now, before 
you write any more application code.)

Best,
--
Marnen Laibow-Koser
http://www.marnen.org
mar...@marnen.org

-- 
Posted via http://www.ruby-forum.com/.

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.


-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to