diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2005-02-07 14:06:00 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2005-02-07 14:06:00 +0000 |
commit | 336c2cbb8f728825139f2ab94b96726935ea18a1 (patch) | |
tree | 1943ecb94336aae84d458a97bd376306dac1118d /activerecord/test/column_alias_test.rb | |
parent | 8382e6e50681fef860fb2856af12fa72853a8488 (diff) | |
download | rails-336c2cbb8f728825139f2ab94b96726935ea18a1.tar.gz rails-336c2cbb8f728825139f2ab94b96726935ea18a1.tar.bz2 rails-336c2cbb8f728825139f2ab94b96726935ea18a1.zip |
Added an Oracle adapter that works with the Oracle bindings by Yoshida (http://raa.ruby-lang.org/project/oracle/) #564 [Maik Schmidt]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@522 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activerecord/test/column_alias_test.rb')
-rw-r--r-- | activerecord/test/column_alias_test.rb | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/activerecord/test/column_alias_test.rb b/activerecord/test/column_alias_test.rb index 06a0a7f3b0..1c84e119f3 100644 --- a/activerecord/test/column_alias_test.rb +++ b/activerecord/test/column_alias_test.rb @@ -5,8 +5,15 @@ class TestColumnAlias < Test::Unit::TestCase def test_column_alias topic = Topic.find(1) - records = topic.connection.select_all("SELECT id AS pk FROM topics LIMIT 1") - assert_equal(records[0].keys[0], "pk") + if ActiveRecord::ConnectionAdapters.const_defined? :OracleAdapter + if ActiveRecord::Base.connection.instance_of?(ActiveRecord::ConnectionAdapters::OracleAdapter) + records = topic.connection.select_all("SELECT id AS pk FROM topics WHERE ROWNUM < 2") + assert_equal(records[0].keys[0], "pk") + end + else + records = topic.connection.select_all("SELECT id AS pk FROM topics LIMIT 1") + assert_equal(records[0].keys[0], "pk") + end end end |