Sql server freetds/odbc question

I’m having an error from Linux via freeTDS/ODBC to SQL Server with
cod that runs fine against SQLite and MySQL. Here’s the code:

def find_recipes_for_workorder_by_id
@recipe_pages, @recipes = paginate_with_sort :recipes, :per_page
=> 10,
:conditions => [“recipe.workorder_id = ?”, params
[:workorder]]
render :template => ‘recipe/list’
end

(I’ve included the custom sorting code at bottom of message.)

Here’s the top of the error:

DBI::DatabaseError ( (8156) [unixODBC][FreeTDS][SQL Server]The column
‘name’ was specified multiple times for ‘tally’.):
/usr/lib/site_ruby/1.8/DBD/ODBC/ODBC.rb:168:in execute' /usr/lib/site_ruby/1.8/dbi/dbi.rb:640:inexecute’
/usr/lib/site_ruby/1.8/dbi/dbi.rb:671:in select_all' /vendor/rails/activerecord/lib/active_record/connection_adapters/ sqlserver_adapter.rb:354:inadd_limit_offset!’
/vendor/rails/activerecord/lib/active_record/base.rb:931:in
add_limit!' /vendor/rails/activerecord/lib/active_record/base.rb:924:inconstruct_finder_sql’

Any help appreciated!

Jamie


class ActionController::Base
def paginate_with_sort(collection_id, options={})
@params[:sort_direction] ||= ‘-1’
asc_desc = {‘1’ => “asc”, ‘-1’ => “desc”}
options[:order] = “#{@params[:sort_by]} #{asc_desc[@params
[:sort_direction]]}” if @params[:sort_by]
@params[:sort_direction] = @params[:sort_direction].to_i * (-1)
paginate collection_id, options
end
end

Don’t bother! That code works! I had run “rake deploy” which appeared
to succeed, but actually hadn’t.

Jamie

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs