Skip to content

Commit

Permalink
Merge pull request #6698 from yahonda/address_ora_911_master
Browse files Browse the repository at this point in the history
Address ORA-00911 errors because of the heading underscore.
  • Loading branch information
rafaelfranca committed Jun 11, 2012
1 parent bbec883 commit c9f27e3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion activerecord/lib/active_record/relation/finder_methods.rb
Expand Up @@ -190,7 +190,7 @@ def exists?(id = false)

join_dependency = construct_join_dependency_for_association_find
relation = construct_relation_for_association_find(join_dependency)
relation = relation.except(:select, :order).select("1 AS _one").limit(1)
relation = relation.except(:select, :order).select("1 AS one").limit(1)

case id
when Array, Hash
Expand Down
2 changes: 1 addition & 1 deletion activerecord/test/cases/finder_test.rb
Expand Up @@ -46,7 +46,7 @@ def test_exists
end

def test_exists_does_not_select_columns_without_alias
assert_sql(/SELECT\W+1 AS _one FROM ["`]topics["`]\W+LIMIT 1/) do
assert_sql(/SELECT\W+1 AS one FROM ["`]topics["`]/i) do
Topic.exists?
end
end
Expand Down

0 comments on commit c9f27e3

Please sign in to comment.