Sha256: cbc43f398c2aff1e78934f320970588b712ea43fbe2aa10418fd6bd68308992c

Contents?: true

Size: 455 Bytes

Versions: 8

Compression:

Stored size: 455 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

8 entries across 8 versions & 1 rubygems

Version Path
ibm_db-5.2.0-x86-mingw32 test/cases/column_alias_test.rb
ibm_db-5.1.0-x86-mingw32 test/cases/column_alias_test.rb
ibm_db-5.0.5-x86-mingw32 test/cases/column_alias_test.rb
ibm_db-5.0.4-x86-mingw32 test/cases/column_alias_test.rb
ibm_db-5.0.3-x86-mingw32 test/cases/column_alias_test.rb
ibm_db-5.0.2-x86-mingw32 test/cases/column_alias_test.rb
ibm_db-3.0.5-x86-mingw32 test/cases/column_alias_test.rb
ibm_db-3.0.5 test/cases/column_alias_test.rb