Sha256: b867cbbf62ed8e66ab18c783ab3299537639a849c3e74d293afe90f62ff051b0

Contents?: true

Size: 439 Bytes

Versions: 97

Compression:

Stored size: 439 Bytes

Contents

require 'abstract_unit'
require 'fixtures/topic'

class TestColumnAlias < Test::Unit::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

97 entries across 97 versions & 7 rubygems

Version Path
activerecord-2.0.1 test/column_alias_test.rb
activerecord-2.0.4 test/column_alias_test.rb
activerecord-2.0.0 test/column_alias_test.rb
activerecord-2.0.5 test/column_alias_test.rb
activerecord-2.0.2 test/column_alias_test.rb
activerecord_authorails-1.0.0 test/column_alias_test.rb
backlog-0.0.0 vendor/rails/activerecord/test/column_alias_test.rb
backlog-0.0.1 vendor/rails/activerecord/test/column_alias_test.rb
backlog-0.0.2 vendor/rails/activerecord/test/column_alias_test.rb
backlog-0.0.4 vendor/rails/activerecord/test/column_alias_test.rb
backlog-0.0.5 vendor/rails/activerecord/test/column_alias_test.rb
backlog-0.1.1 vendor/rails/activerecord/test/column_alias_test.rb
backlog-0.1.0 vendor/rails/activerecord/test/column_alias_test.rb
backlog-0.1.2 vendor/rails/activerecord/test/column_alias_test.rb
backlog-0.2.0 vendor/rails/activerecord/test/column_alias_test.rb
backlog-0.2.1 vendor/rails/activerecord/test/column_alias_test.rb
backlog-0.3.0 vendor/rails/activerecord/test/column_alias_test.rb
backlog-0.3.3 vendor/rails/activerecord/test/column_alias_test.rb
backlog-0.3.1 vendor/rails/activerecord/test/column_alias_test.rb
backlog-0.3.2 vendor/rails/activerecord/test/column_alias_test.rb