diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2005-07-01 17:20:04 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2005-07-01 17:20:04 +0000 |
commit | f2a29ca43cb0de38a25bf7f68bca5c11871692ce (patch) | |
tree | 49fafc3247a77dc1b8797e4425b28923af6a51d0 /activerecord/test/inheritance_test.rb | |
parent | 64612db7cf85aee8434e7b9b4fd8d6d0249c60e4 (diff) | |
download | rails-f2a29ca43cb0de38a25bf7f68bca5c11871692ce.tar.gz rails-f2a29ca43cb0de38a25bf7f68bca5c11871692ce.tar.bz2 rails-f2a29ca43cb0de38a25bf7f68bca5c11871692ce.zip |
Added support for ODBC connections to MS SQL Server so you can connect from a non-Windows machine #1569 [Mark Imbriaco/DeLynn Berry] Added support for limit/offset with the MS SQL Server driver so that pagination will now work #1569 [DeLynn Berry]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1583 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activerecord/test/inheritance_test.rb')
-rwxr-xr-x | activerecord/test/inheritance_test.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/activerecord/test/inheritance_test.rb b/activerecord/test/inheritance_test.rb index 3ac29b73c8..dbbbb6eee7 100755 --- a/activerecord/test/inheritance_test.rb +++ b/activerecord/test/inheritance_test.rb @@ -6,7 +6,15 @@ class InheritanceTest < Test::Unit::TestCase fixtures :companies, :projects def test_a_bad_type_column + #SQLServer need to turn Identity Insert On before manually inserting into the Identity column + if ActiveRecord::ConnectionAdapters.const_defined? :SQLServerAdapter and ActiveRecord::Base.connection.instance_of?(ActiveRecord::ConnectionAdapters::SQLServerAdapter) + Company.connection.execute "SET IDENTITY_INSERT companies ON" + end Company.connection.insert "INSERT INTO companies (id, type, name) VALUES(100, 'bad_class!', 'Not happening')" + #We then need to turn it back Off before continuing. + if ActiveRecord::ConnectionAdapters.const_defined? :SQLServerAdapter and ActiveRecord::Base.connection.instance_of?(ActiveRecord::ConnectionAdapters::SQLServerAdapter) + Company.connection.execute "SET IDENTITY_INSERT companies OFF" + end assert_raises(ActiveRecord::SubclassNotFound) { Company.find(100) } end |