Skip to content

Commit b5d82e2

Browse files
committed
Merge pull request rails#6698 from yahonda/address_ora_911_master
Address ORA-00911 errors because of the heading underscore.
2 parents f48e767 + a0363e2 commit b5d82e2

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

activerecord/lib/active_record/relation/finder_methods.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ def exists?(id = false)
176176

177177
join_dependency = construct_join_dependency_for_association_find
178178
relation = construct_relation_for_association_find(join_dependency)
179-
relation = relation.except(:select, :order).select("1 AS _one").limit(1)
179+
relation = relation.except(:select, :order).select("1 AS one").limit(1)
180180

181181
case id
182182
when Array, Hash

activerecord/test/cases/finder_test.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ def test_exists
4646
end
4747

4848
def test_exists_does_not_select_columns_without_alias
49-
assert_sql(/SELECT\W+1 AS _one FROM ["`]topics["`]\W+LIMIT 1/) do
49+
assert_sql(/SELECT\W+1 AS one FROM ["`]topics["`]/i) do
5050
Topic.exists?
5151
end
5252
end

0 commit comments

Comments
 (0)