Ok so i have the string "Product".
table_name = "Product"
I cant do
table_name.new
undefined method `new
So i was trying to find a work around like this
table_name = table_name.downcase.pluralize
name = ActiveRecord::Base.connection.tables.select { |t| t == table_name }.first
name.new
I am not sure this will work but even if it does it looks like a hack, any ideas to clean this up