Imagine an array of strings ["User","Article","Image"], what’s the best way of evaluating their class declarations into the current scope? I’m imagining something like:
array.each do |element|
instance_eval<<EOF
class #{element} < ActiveRecord::Base
end
EOF
end
Is this the proper way of doing it?
How about this?