I'm using Sequel ORM
@latestorder = Step.where(:tutorial_id =>data['tutorial_id']).order(Sequel.desc(:order)).limit(1) #data['tutorial_id'] is 1
@neworder = @latestorder[:order] +1; #<-- this line causes errors!
NoMethodError at /makenew/stepundefined method `+' for #<Step:0x2f85138>
Using .to_i
does not work and I cannot use DB[]
for this query.
Output of @latestorder and @latestorder[:order]
<?r @latestorder.inspect ?>
#
<?r @latestorder.each do |late| ?>
#{late.inspect}
<?r end ?>
#13, :user_id=>1, :tutorial_id=>1, :order=>9, :title=>"Choose a group", :instruction=>"From the groups page, choose one of the groups to go on. \r\n\r\nFor testing purposes if you have the password for flyasakite, choose the All About Compesh group", :url=>"http://compesh.com/groups", :datenumber=>"2012-11-10", :datetimenumber=>"2012-11-10 13:18"}>
<?r @latestorder.each do |late| ?>
#{late.order.inspect}
<?r end ?>
9
I need to be able to add 1 to the @latestorder that has a LIMIT of 1, without going inside an .each
loop