Skip to content

Instantly share code, notes, and snippets.

View metaskills's full-sized avatar
🧠
Adding Digital Intelligence

Ken Collins metaskills

🧠
Adding Digital Intelligence
View GitHub Profile
diff --git a/activerecord/test/schema/schema.rb b/activerecord/test/schema/schema.rb
index 7657e00..ea62833 100644
--- a/activerecord/test/schema/schema.rb
+++ b/activerecord/test/schema/schema.rb
@@ -233,7 +233,7 @@ ActiveRecord::Schema.define do
end
create_table :items, :force => true do |t|
- t.column :name, :integer
+ t.column :name, :string
Setting Up A Local Port Repo:
http://journal.bitshaker.com/articles/2007/10/20/install-old-versions-of-ports-using-macports/
http://trac.macports.org/wiki/howto/InstallingOlderPort
1) Add this to /opt/local/etc/macports/sources.conf
file:///Users/kencollins/Repositories/ports [nosync]
2) mkdir /Users/kencollins/Repositories/ports
1) Error:
test_create_by(HasManyAssociationsTest):
ArgumentError: odd number of arguments for Hash
/Users/kencollins/Repositories/rails/activerecord/test/cases/../../lib/active_record/associations/association_collection.rb:386:in `[]'
/Users/kencollins/Repositories/rails/activerecord/test/cases/../../lib/active_record/associations/association_collection.rb:386:in `method_missing'
/Users/kencollins/Repositories/rails/activerecord/test/cases/associations/has_many_associations_test.rb:31:in `test_create_by'
/Users/kencollins/Repositories/rails/activerecord/test/cases/../../../activesupport/lib/active_support/testing/setup_and_teardown.rb:62:in `__send__'
/Users/kencollins/Repositories/rails/activerecord/test/cases/../../../activesupport/lib/active_support/testing/setup_and_teardown.rb:62:in `run'
2) Error:
Topic.columns_hash['written_on'].sql_type # => "datetime"
Topic.columns_hash['bonus_time'].sql_type # => "time"
Topic.columns_hash['last_read'].sql_type # => "date"
Topic.count # => 4
data = Topic.connection.send(:select,"SELECT `topics`.* FROM `topics`")
row = data[0]
row['written_on'] # => 2003-07-16 10:28:11 UTC
row['written_on'].class # => Time
require 'odbc_utf8'
con = ODBC.connect 'vm2008', 'rails', ''
h = con.run "SELECT N'v' AS N'n'"
v = h.fetch.first # => ODBC::Error: HY003 (0) [unixODBC][FreeTDS][SQL Server]Program type out of range
v.encoding # =>
h.drop
sth_runprc = con.run "EXEC sp_helpconstraint 'people', 'nomsg'"
= Using 0.9999pre6 'odbc'
∴ ruby test_odbc_utf8.rb
å
ASCII-8BIT
= Using 0.9999pre6 'odbc_utf8'
∴ ruby test_odbc_utf8.rb
= Information About My Current Install
∴ tsql -C
Compile-time settings (established with the "configure" script)
Version: freetds v0.83.dev.20100819
freetds.conf directory: /opt/local/etc/freetds
MS db-lib source compatibility: no
Sybase binary compatibility: no
Thread safety: yes
class Foo
attr_accessor :bar, :batz
def initialize(bar,batz)
@bar, @batz = bar, batz
end
end
f = Foo.new('bar','batz') # =>
f.bar # =>
diff --git a/lib/active_record/connection_adapters/sqlserver/database_statements.rb b/lib/active_record/connection_adapters/sqlserver/database_statements.rb
index 49194d3..3c3c78c 100644
--- a/lib/active_record/connection_adapters/sqlserver/database_statements.rb
+++ b/lib/active_record/connection_adapters/sqlserver/database_statements.rb
@@ -256,27 +256,37 @@ module ActiveRecord
def handle_to_names_and_values_odbc(handle, options={})
case options[:fetch]
when :all, :one
- rows = if options[:fetch] == :all
- handle.fetch_all || []
require 'bench_press'
extend BenchPress
author 'Ken Collins'
summary 'Checking a collection.'
reps 100_000
class Foo
def bar