Sha256: 8f327c0ecbddf19b461808d92f8f086d31f7f36ae605b05d237ce5dd8dbb7da3

Contents?: true

Size: 436 Bytes

Versions: 4

Compression:

Stored size: 436 Bytes

Contents

require 'abstract_unit'
require 'fixtures/topic'

class TestColumnAlias < Test::Unit::TestCase
  fixtures :topics

  QUERY = if 'OCI' == 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

4 entries across 4 versions & 1 rubygems

Version Path
activerecord-1.13.0 test/column_alias_test.rb
activerecord-1.12.2 test/column_alias_test.rb
activerecord-1.13.1 test/column_alias_test.rb
activerecord-1.13.2 test/column_alias_test.rb