mirror of
https://github.com/lloeki/rebel.git
synced 2025-12-06 01:54:40 +01:00
Replace '*' by :*
This commit is contained in:
parent
cfe0851f04
commit
02043ec233
2 changed files with 2 additions and 2 deletions
|
|
@ -288,7 +288,7 @@ module Rebel
|
||||||
def name(name = nil)
|
def name(name = nil)
|
||||||
super() if name.nil? # workaround for pry and introspection
|
super() if name.nil? # workaround for pry and introspection
|
||||||
return name if name.is_a?(Raw)
|
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('.'))
|
raw(name.to_s.split('.').map { |e| "#{@identifier_quote}#{e}#{@identifier_quote}" }.join('.'))
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -44,6 +44,6 @@ class TestExec < Minitest::Test
|
||||||
def test_select
|
def test_select
|
||||||
create_table :foo, id: 'INT', col: 'VARCHAR(255)'
|
create_table :foo, id: 'INT', col: 'VARCHAR(255)'
|
||||||
insert_into :foo, id: 1, col: 'whatevs'
|
insert_into :foo, id: 1, col: 'whatevs'
|
||||||
assert_equal(select('*', from: :foo), [[1, 'whatevs']])
|
assert_equal(select(:*, from: :foo), [[1, 'whatevs']])
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue