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, #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, #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, #hour, #minute, #month, #second, #wday, #week, #year

Methods included from ArelExtensions::Comparators

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

Methods included from ArelExtensions::Math

#+, #-

Instance Method Details

#as(other) ⇒ Object



136
137
138
139
140
141
142
# File 'lib/arel_extensions.rb', line 136

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