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
ginst-2.0.1 vendor/rails/activerecord/test/cases/column_alias_test.rb
ginst-2.0.0 vendor/rails/activerecord/test/cases/column_alias_test.rb
gemstreamer-1.2.0 spec/assets/testapp/vendor/rails/activerecord/test/cases/column_alias_test.rb
gemstreamer-1.1.1 spec/assets/testapp/vendor/rails/activerecord/test/cases/column_alias_test.rb
gemstreamer-1.1.0 spec/assets/testapp/vendor/rails/activerecord/test/cases/column_alias_test.rb
gemstreamer-1.0.0 spec/assets/testapp/vendor/rails/activerecord/test/cases/column_alias_test.rb
gemstreamer-0.0.0 spec/assets/testapp/vendor/rails/activerecord/test/cases/column_alias_test.rb
radiant-rc-0.9.0 vendor/rails/activerecord/test/cases/column_alias_test.rb
activerecord-2.2.3 test/cases/column_alias_test.rb
webroar-0.2.2 src/admin_panel/vendor/rails/activerecord/test/cases/column_alias_test.rb
radiant-0.8.1 vendor/rails/activerecord/test/cases/column_alias_test.rb
activerecord-2.3.4 test/cases/column_alias_test.rb
activerecord-2.3.3 test/cases/column_alias_test.rb
activerecord-2.2.2 test/cases/column_alias_test.rb
activerecord-2.1.2 test/cases/column_alias_test.rb
activerecord-2.1.0 test/cases/column_alias_test.rb
activerecord-2.3.2 test/cases/column_alias_test.rb
activerecord-2.1.1 test/cases/column_alias_test.rb
antfarm-0.3.0 rails/vendor/rails/activerecord/test/cases/column_alias_test.rb
antfarm-0.4.0 rails/vendor/rails/activerecord/test/cases/column_alias_test.rb