Replace '*' by :*

This commit is contained in:
Loic Nageleisen 2017-11-22 15:13:20 +01:00
parent cfe0851f04
commit 02043ec233
2 changed files with 2 additions and 2 deletions

View file

@ -288,7 +288,7 @@ module Rebel
def name(name = nil)
super() if name.nil? # workaround for pry and introspection
return name if name.is_a?(Raw)
return raw('*') if name == '*'
return raw('*') if name == :*
raw(name.to_s.split('.').map { |e| "#{@identifier_quote}#{e}#{@identifier_quote}" }.join('.'))
end

View file

@ -44,6 +44,6 @@ class TestExec < Minitest::Test
def test_select
create_table :foo, id: 'INT', col: 'VARCHAR(255)'
insert_into :foo, id: 1, col: 'whatevs'
assert_equal(select('*', from: :foo), [[1, 'whatevs']])
assert_equal(select(:*, from: :foo), [[1, 'whatevs']])
end
end