Class: Arel::Nodes::Function

Direct Known Subclasses

ArelExtensions::Nodes::Function

Instance Method Summary collapse

Methods included from ArelExtensions::Predications

#cast, #convert_to_node, #imatches, #in, #matches, #not_in, #when

Methods included from ArelExtensions::NullFunctions

#coalesce, #coalesce_blank, #if_present, #is_not_null, #is_null

Methods included from ArelExtensions::BooleanFunctions

#and, #or, #then, #⋀, #⋁

Methods included from ArelExtensions::StringFunctions

#&, #[], #ai_collate, #ai_imatches, #ai_matches, #blank, #byte_length, #char_length, #ci_collate, #collate, #concat, #downcase, #edit_distance, #group_concat, #idoes_not_match, #idoes_not_match_all, #idoes_not_match_any, #imatches, #imatches_all, #imatches_any, #length, #levenshtein_distance, #locate, #ltrim, #md5, #not_blank, #regexp_replace, #repeat, #replace, #rtrim, #smatches, #soundex, #substring, #trim, #upcase

Methods included from ArelExtensions::MathFunctions

#*, #/, #abs, #ceil, #floor, #format_number, #log10, #pow, #power, #round, #std, #sum, #variance

Methods included from ArelExtensions::DateDuration

#day, #format, #format_date, #hour, #minute, #month, #second, #wday, #week, #year

Methods included from ArelExtensions::Comparators

#!~, #<, #<=, #=~, #>, #>=

Methods included from ArelExtensions::Math

#+, #-

Methods included from ArelExtensions::Aliases

#xas

Instance Method Details

#as(other) ⇒ Object



182
183
184
185
186
187
188
# File 'lib/arel_extensions.rb', line 182

def as other
  res = Arel::Nodes::As.new(self.clone, Arel.sql(other))
  if Gem::Version.new(Arel::VERSION) >= Gem::Version.new('9.0.0')
    self.alias = Arel.sql(other)
  end
  res
end