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
radiantcms-couchrest_model-0.2.1 vendor/rails/activerecord/test/cases/column_alias_test.rb
radiantcms-couchrest_model-0.2 vendor/rails/activerecord/test/cases/column_alias_test.rb
radiantcms-couchrest_model-0.1.9 vendor/rails/activerecord/test/cases/column_alias_test.rb
radiantcms-couchrest_model-0.1.8 vendor/rails/activerecord/test/cases/column_alias_test.rb
radiantcms-couchrest_model-0.1.7 vendor/rails/activerecord/test/cases/column_alias_test.rb
radiantcms-couchrest_model-0.1.6 vendor/rails/activerecord/test/cases/column_alias_test.rb
radiantcms-couchrest_model-0.1.5 vendor/rails/activerecord/test/cases/column_alias_test.rb
radiantcms-couchrest_model-0.1.4 vendor/rails/activerecord/test/cases/column_alias_test.rb
radiantcms-couchrest_model-0.1.3 vendor/rails/activerecord/test/cases/column_alias_test.rb
radiantcms-couchrest_model-0.1.2 vendor/rails/activerecord/test/cases/column_alias_test.rb
radiantcms-couchrest_model-0.1.1 vendor/rails/activerecord/test/cases/column_alias_test.rb
radiantcms-couchrest_model-0.1 vendor/rails/activerecord/test/cases/column_alias_test.rb
radiant-0.7.2 vendor/rails/activerecord/test/cases/column_alias_test.rb
activerecord-2.3.10 test/cases/column_alias_test.rb
activerecord-2.3.9 test/cases/column_alias_test.rb
activerecord-2.3.9.pre test/cases/column_alias_test.rb
vibes-bj-1.2.2 spec/rails_root/vendor/rails/activerecord/test/cases/column_alias_test.rb
vibes-bj-1.2.1 spec/rails_root/vendor/rails/activerecord/test/cases/column_alias_test.rb
webroar-0.4.0 src/admin_panel/vendor/rails/activerecord/test/cases/column_alias_test.rb
nbudin-castronaut-0.7.5 vendor/activerecord/test/cases/column_alias_test.rb