Returns the string aliased (including ‘as’) as the aliased name
"book".as(:category) #=> :"'book' as category"
[Source]
# File lib/string.rb, line 16 16: def as(alias_name) 17: "#{self.to_sql} as #{alias_name}".to_sym 18: end
Returns a string with single quotes escaped.
:book.to_sql #=> "book"
# File lib/string.rb, line 7 7: def to_sql 8: "'#{self.gsub(/'/, "''")}'" 9: end
[Validate]