diff --git a/lib/rebel/sql.rb b/lib/rebel/sql.rb index d0680b8..6ea99f7 100644 --- a/lib/rebel/sql.rb +++ b/lib/rebel/sql.rb @@ -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 diff --git a/test/test_exec.rb b/test/test_exec.rb index cf7c18c..f9cb146 100644 --- a/test/test_exec.rb +++ b/test/test_exec.rb @@ -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