I need to create a Ruby class on the fly, i.e. dynamically which comes from ActiveRecord::Base. I use for evalnow:
eval %Q{
class ::#{klass} < ActiveRecord::Base
self.table_name = "#{table_name}"
end
}
Is there an equivalent and at least as concise way to do this without using eval?
Drtom source
share