Rob Nichols wrote:
David Fitzgibbon wrote:
Splendid. This worked a treat:
if eval(history.model).find(:first, :conditions => ["id = ?",
Thank you David and Chris for your prompt and useful responses.
You can also do model_name.constantize.find......
if however 'model_name' isn't the actual name of the class - meaning
'MyTable' and not eg. 'my_tables' - you need to call classify first, eg.
eval is also pretty cool though :]
Hope this helps!