Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fixed anonymous columns
  • Loading branch information
Nusco+Beppe committed Jul 29, 2008
1 parent 2d157d9 commit 8c07467
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/sequel_core/adapters/ado.rb
Expand Up @@ -59,7 +59,7 @@ def fetch_rows(sql, &block)
s = @db.execute sql

@columns = s.Fields.extend(Enumerable).map do |column|
name = column.Name.empty? ? 'no column name' : column.Name
name = column.Name.empty? ? '(no column name)' : column.Name
name.to_sym
end

Expand Down
4 changes: 2 additions & 2 deletions spec/adapters/ado_spec.rb
@@ -1,7 +1,7 @@
require File.join(File.dirname(__FILE__), 'spec_helper.rb')

unless defined?(ADO_DB)
ADO_DB = Sequel.ado(:host => 'AZTEC', :database => 'Uno_test', :user => 'sa', :password => 'sadev')
ADO_DB = Sequel.ado(:host => 'MY_SQL_SERVER', :database => 'MyDB', :user => 'my_pwd', :password => 'my_usr')
end

context "An ADO dataset" do
Expand All @@ -23,7 +23,7 @@

specify "should assign a default name to anonymous columns" do
col = ADO_DB.fetch('SELECT COUNT(*) FROM items').columns[0]
col.name.should == '(no column name)'
col.to_s.should == '(no column name)'
end

specify "should support counting" do
Expand Down

0 comments on commit 8c07467

Please sign in to comment.