I am trying to do this using SQL in Ruby:
SELECT number*2 FROM dictionary;
I can use .select(:number)
to get the number columns "as is", but I have no idea how to return them modified. I tried this (which obviously didn't work):
current_table.select(:number*2)
Try either of these
@newnumber = number.find(:all, :conditions => ["id = ?", @dictionary.id], :select => "number * 2 as newnumber")
@newnumber = number.all(:conditions=>"id='#{@dictionary.id}'",:select=>"number * 2 as newnumber")