lib/arel/extensions/variable_show.rb in arel_toolkit-0.3.0 vs lib/arel/extensions/variable_show.rb in arel_toolkit-0.4.0
- old
+ new
@@ -2,26 +2,21 @@
# rubocop:disable Naming/UncommunicativeMethodParamName
module Arel
module Nodes
# https://www.postgresql.org/docs/9.1/sql-show.html
- class VariableShow < Arel::Nodes::Node
- attr_reader :name
-
- def initialize(name)
- @name = name
- end
+ class VariableShow < Arel::Nodes::Unary
end
end
module Visitors
class ToSql
def visit_Arel_Nodes_VariableShow(o, collector)
collector << 'SHOW '
- collector << if o.name == 'timezone'
+ collector << if o.expr == 'timezone'
'TIME ZONE'
else
- o.name
+ o.expr
end
end
end
end
end