Using .find_by_sql for database/admin queries

Ben Knight wrote:

I want to create an internal admin view to display the output of "show
variables" from mysql. What's the best approach do this?

For example, I'm doing something like this:

   @variables = ActiveRecord::Base.find_by_sql "show variables;"

Then, I get stuff like this back (227 elements in @variables) in

  >> @variables[0]
  => #<ActiveRecord::Base:0x3296eec
@attributes={"Variable_name"=>"auto_increment_increment", "Value"=>"1"}>

However, I'm not sure how to get Variable_name and Value; do I access
this as a Hash element? An attribute?

Should I create a custom Model class such as this?
  class MySql < ActiveRecord::Base

Thanks in advance.

Try something like:

ActiveRecord::Base.connection.select_all "show variables"