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
activerecord-nuodb-adapter-1.1 test/cases/column_alias_test.rb
activerecord-nuodb-adapter-1.0.4 test/cases/column_alias_test.rb
activerecord-2.3.18 test/cases/column_alias_test.rb
activerecord_csi-2.3.5.p8 test/cases/column_alias_test.rb
activerecord-2.3.17 test/cases/column_alias_test.rb
activerecord_csi-2.3.5.p7 test/cases/column_alias_test.rb
activerecord_csi-2.3.5.p6 test/cases/column_alias_test.rb
activerecord-2.3.16 test/cases/column_alias_test.rb
activerecord-2.3.15 test/cases/column_alias_test.rb
radiant-1.0.0 ruby-debug/ruby/1.8/gems/activerecord-2.3.14/test/cases/column_alias_test.rb
vanity-1.7.1 vendor/ruby/1.9.1/gems/activerecord-2.3.12/test/cases/column_alias_test.rb
activerecord-2.3.14 test/cases/column_alias_test.rb
kajam-1.0.3.rc2 vendor/rails/activerecord/test/cases/column_alias_test.rb
activerecord-2.3.12 test/cases/column_alias_test.rb
radiant-1.0.0.rc2 vendor/rails/activerecord/test/cases/column_alias_test.rb
radiant-1.0.0.rc1 vendor/rails/activerecord/test/cases/column_alias_test.rb
webroar-0.5.0 src/admin_panel/vendor/rails/activerecord/test/cases/column_alias_test.rb
activerecord-2.3.11 test/cases/column_alias_test.rb
radiantcms-couchrest_model-0.2.4 vendor/rails/activerecord/test/cases/column_alias_test.rb
radiantcms-couchrest_model-0.2.2 vendor/rails/activerecord/test/cases/column_alias_test.rb