mirror of
https://github.com/lloeki/rebel.git
synced 2025-12-06 01:54:40 +01:00
Fix introspection when extending with Rebel::SQLB
This commit is contained in:
parent
c746cf18aa
commit
f315679713
1 changed files with 11 additions and 1 deletions
|
|
@ -285,7 +285,8 @@ module Rebel
|
||||||
|
|
||||||
## Support
|
## Support
|
||||||
|
|
||||||
def name(name)
|
def name(name = nil)
|
||||||
|
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 == '*'
|
||||||
|
|
||||||
|
|
@ -402,6 +403,15 @@ module Rebel
|
||||||
|
|
||||||
extend Rebel::SQLB
|
extend Rebel::SQLB
|
||||||
include Rebel::SQLQ
|
include Rebel::SQLQ
|
||||||
|
|
||||||
|
def self.name(name = nil)
|
||||||
|
return "Rebel::SQL" if name.nil?
|
||||||
|
super
|
||||||
|
end
|
||||||
|
|
||||||
|
def self.inspect
|
||||||
|
"#<Rebel::SQL(#{instance_variables.map { |k| "#{k.to_s.sub(/^@/, '')}: #{instance_variable_get(k).inspect}" }.join(', ')})>"
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
return sql.instance_eval(&block) unless block.nil?
|
return sql.instance_eval(&block) unless block.nil?
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue