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
masover-castronaut-0.4.4.5 vendor/activerecord/test/cases/column_alias_test.rb
masover-castronaut-0.5.0.1 vendor/activerecord/test/cases/column_alias_test.rb
p8-castronaut-0.6.1.1 vendor/activerecord/test/cases/column_alias_test.rb
relevance-castronaut-0.4.1 vendor/activerecord/test/cases/column_alias_test.rb
relevance-castronaut-0.4.2 vendor/activerecord/test/cases/column_alias_test.rb
relevance-castronaut-0.4.3 vendor/activerecord/test/cases/column_alias_test.rb
relevance-castronaut-0.4.4 vendor/activerecord/test/cases/column_alias_test.rb
relevance-castronaut-0.4.5 vendor/activerecord/test/cases/column_alias_test.rb
relevance-castronaut-0.4.6 vendor/activerecord/test/cases/column_alias_test.rb
relevance-castronaut-0.5.0 vendor/activerecord/test/cases/column_alias_test.rb
relevance-castronaut-0.5.1 vendor/activerecord/test/cases/column_alias_test.rb
relevance-castronaut-0.5.2 vendor/activerecord/test/cases/column_alias_test.rb
relevance-castronaut-0.5.3 vendor/activerecord/test/cases/column_alias_test.rb
relevance-castronaut-0.5.4 vendor/activerecord/test/cases/column_alias_test.rb
relevance-castronaut-0.6.0 vendor/activerecord/test/cases/column_alias_test.rb
relevance-castronaut-0.6.1 vendor/activerecord/test/cases/column_alias_test.rb
relevance-castronaut-0.7.4 vendor/activerecord/test/cases/column_alias_test.rb
relevance-castronaut-0.7.5 vendor/activerecord/test/cases/column_alias_test.rb
activerecord-nuodb-adapter-2.0.3 test/cases/column_alias_test.rb
activerecord-nuodb-adapter-2.0 test/cases/column_alias_test.rb