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
radiant-0.9.1 vendor/rails/activerecord/test/cases/column_alias_test.rb
activerecord-2.3.8 test/cases/column_alias_test.rb
activerecord-2.3.8.pre1 test/cases/column_alias_test.rb
activerecord-2.3.7 test/cases/column_alias_test.rb
activerecord-2.3.6 test/cases/column_alias_test.rb
radiant-0.8.2 vendor/rails/activerecord/test/cases/column_alias_test.rb
radiant-0.9.0.rc2 vendor/rails/activerecord/test/cases/column_alias_test.rb
webroar-0.3.1 src/admin_panel/vendor/rails/activerecord/test/cases/column_alias_test.rb
webroar-0.3.0 src/admin_panel/vendor/rails/activerecord/test/cases/column_alias_test.rb
usher-0.7.0 spec/rails2_3/vendor/rails/vendor/rails/activerecord/test/cases/column_alias_test.rb
usher-0.7.0 spec/rails2_2/vendor/rails/vendor/rails/activerecord/pkg/activerecord-2.2.2/test/cases/column_alias_test.rb
usher-0.7.0 spec/rails2_2/vendor/rails/vendor/rails/activerecord/test/cases/column_alias_test.rb
usher-0.7.0 spec/rails2_3/vendor/rails/vendor/rails/activerecord/pkg/activerecord-2.3.3/test/cases/column_alias_test.rb
simply_stated-0.0.5 vendor/gems/ruby/1.8/gems/activerecord-2.3.5/test/cases/column_alias_test.rb
simply_stated-0.0.4 vendor/gems/ruby/1.8/gems/activerecord-2.3.5/test/cases/column_alias_test.rb
factorylabs-castronaut-0.7.5 vendor/activerecord/test/cases/column_alias_test.rb
ginst-2009.12.8 vendor/rails/activerecord/test/cases/column_alias_test.rb
activerecord-2.3.5 test/cases/column_alias_test.rb
ginst-2009.11.24 vendor/rails/activerecord/test/cases/column_alias_test.rb
ginst-2009.11.23 vendor/rails/activerecord/test/cases/column_alias_test.rb