Hi

This is difficult (for me, at least ;) )

I have a model named Measureunit and another named Vendor

Each vendor has a measureunit for the currency it use, and the association 
is currency

In vendor.rb I have
belongs_to :currency, :class_name => "Measureunit" , :foreign_key => 
"currency_id"

How can I recover the class name from the association name (eg. I have the 
string 'Currency' and I look for
a method that return 'Measureunit')

I found class_name() and klass() but I can't figure the syntax...

Tnx!

-- 
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/-/fSQcETbwG54J.
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