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
jstorimer-deep-test-2.0.0 sample_rails_project/vendor/rails/activerecord/test/column_alias_test.rb
jstorimer-deep-test-1.4.0 sample_rails_project/vendor/rails/activerecord/test/column_alias_test.rb
jstorimer-deep-test-1.3.0 sample_rails_project/vendor/rails/activerecord/test/column_alias_test.rb
jstorimer-deep-test-1.2.0 sample_rails_project/vendor/rails/activerecord/test/column_alias_test.rb
jstorimer-deep-test-1.1.0 sample_rails_project/vendor/rails/activerecord/test/column_alias_test.rb
jstorimer-deep-test-1.0.0 sample_rails_project/vendor/rails/activerecord/test/column_alias_test.rb
jstorimer-deep-test-0.2.0 sample_rails_project/vendor/rails/activerecord/test/column_alias_test.rb
jstorimer-deep-test-0.1.0 sample_rails_project/vendor/rails/activerecord/test/column_alias_test.rb
activerecord-1.14.2 test/column_alias_test.rb
activerecord-1.14.0 test/column_alias_test.rb
activerecord-1.14.3 test/column_alias_test.rb
activerecord-1.14.1 test/column_alias_test.rb
activerecord-1.15.3 test/column_alias_test.rb
activerecord-1.15.1 test/column_alias_test.rb
activerecord-1.14.4 test/column_alias_test.rb
activerecord-1.15.2 test/column_alias_test.rb
activerecord-1.15.0 test/column_alias_test.rb
activerecord-1.15.4 test/column_alias_test.rb
activerecord-1.15.5 test/column_alias_test.rb
activerecord-1.15.6 test/column_alias_test.rb