Hi,

I have a model tests_user and score which are associated with each other by 
has_one and belongs_to association.

class TestsUser < ActiveRecord::Base
has_one :score, :foreign_key => :reg_no
end

class TestsUser < ActiveRecord::Base
        belongs_to :tests_user, :foreign_key => :reg_no
end

where reg_no is a unique field in both the table!

   score = Score.find(:first) gives me the first record from score table

*Now as i do score.tests_user it gives nill.*

and same with if i do
   test_user = TestsUser.find(:first)
* then test_user.score is showing as nil...*
*
*
*
*
Is this issue because of the foreign_key is not the default id!!!!




-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/rubyonrails-talk/-/HmuXi4iXzGAJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to