I am trying to do this, where associated_record_type is always of the name
of a model, passed to the method:

record =  eval("#{associated_record_type}").find_by_id(associated_record_id)

Is there a way to do this dynamically without using an eval?

-- 
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-talk@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