Sha256: 3c6878c90392c5356b7a4b79edaf61e8b4f653495dc0b8e9e13ee52429cd4057

Contents?: true

Size: 437 Bytes

Versions: 6

Compression:

Stored size: 437 Bytes

Contents

# frozen_string_literal: true

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

6 entries across 6 versions & 2 rubygems

Version Path
ibm_db-5.5.0 test/cases/column_alias_test.rb
ibm_db-5.4.1 test/cases/column_alias_test.rb
ibm_db-5.4.0 test/cases/column_alias_test.rb
ibm_db-5.3.2 test/cases/column_alias_test.rb
ibm_db-5.3.1 test/cases/column_alias_test.rb
ruby-on-quails-0.1.0 activerecord/test/cases/column_alias_test.rb