Setting a :has_many :through association on a belongs_to association Ruby on Rails?

You just create the method to access it class Model2 :model1 end.

The delegation part gives me this error "Delegation needs a target. Supply an options hash with a :to key as the last argument (e.g. Delegate :hello, :to => :greeter).". Let me try the method part – Rohit Oct 5 '10 at 13:45 The first way is doing good and solves my problem.

But please find some tweaks in the delegation mechanism and edit the answer. :D – Rohit Oct 5 '10 at 13:59 use delegate :model3s, :to => :model1 instead of delegate :model3s, :as => :model1. :D works for me – Rohit Oct 5 '10 at 14:04 You right.

I need check the documentation befopre answer sometimes. – shingara Oct 5 '10 at 14:12.

This will have active record join model2 and model3 by model1_id leaving model1 completely out of it and should be more efficient. Terms of service. Not the answer you're looking for?

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions