Sha256: 11172e2e993e1c6d0aec6246c43c2f3d7c9bbfc37445b3753c5ed95aa7078c95

Contents?: true

Size: 438 Bytes

Versions: 123

Compression:

Stored size: 438 Bytes

Contents

require "cases/helper"
require 'models/topic'

class TestColumnAlias < ActiveRecord::TestCase
  fixtures :topics

  QUERY = if 'Oracle' == ActiveRecord::Base.connection.adapter_name
            'SELECT id AS pk FROM topics WHERE ROWNUM < 2'
          else
            'SELECT id AS pk FROM topics'
          end

  def test_column_alias
    records = Topic.connection.select_all(QUERY)
    assert_equal 'pk', records[0].keys[0]
  end
end

Version data entries

123 entries across 120 versions & 23 rubygems

Version Path
ibm_db-5.2.0 test/cases/column_alias_test.rb
ibm_db-5.1.0 test/cases/column_alias_test.rb
ibm_db-5.0.5 test/cases/column_alias_test.rb
ibm_db-5.0.4 test/cases/column_alias_test.rb
ibm_db-5.0.3 test/cases/column_alias_test.rb
ibm_db-5.0.2 test/cases/column_alias_test.rb
ibm_db-4.0.0-x86-mingw32 test/cases/column_alias_test.rb
ibm_db-4.0.0 test/cases/column_alias_test.rb
ibm_db-3.0.4-x86-mingw32 test/cases/column_alias_test.rb
ibm_db-3.0.4 test/cases/column_alias_test.rb
ibm_db-3.0.3-x86-mingw32 test/cases/column_alias_test.rb
ibm_db-3.0.3 test/cases/column_alias_test.rb
ibm_db-3.0.2-x86-mingw32 test/cases/column_alias_test.rb
ibm_db-3.0.2 test/cases/column_alias_test.rb
activejob-lock-0.0.2 rails/activerecord/test/cases/column_alias_test.rb
ibm_db-3.0.1 test/cases/column_alias_test.rb
ibm_db-3.0.1-x86-mingw32 test/cases/column_alias_test.rb
activejob-lock-0.0.1 rails/activerecord/test/cases/column_alias_test.rb
3mix-castronaut-0.5.0.2 vendor/activerecord/test/cases/column_alias_test.rb
masover-castronaut-0.4.4.4 vendor/activerecord/test/cases/column_alias_test.rb