using %{} or %() also saves you from escaping embedded quotes in a
string, such as:
ActiveRecord::Base.connection.execute(%{select id,admin_comments
into outfile "#{file_name}.txt" fields terminated by "," enclosed by
"""" from users where admin_comments!="";})