Class: Arel::Attributes::Attribute

Inherits:
Object
  • Object
show all
Includes:
Math, ArelExtensions::Attributes
Defined in:
lib/arel_extensions.rb,
lib/arel_extensions.rb

Instance Method Summary collapse

Methods included from ArelExtensions::Attributes

#!=, #==

Methods included from ArelExtensions::Predications

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

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::NullFunctions

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

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

#rollupObject



314
315
316
# File 'lib/arel_extensions.rb', line 314

def rollup
  Arel::Nodes::RollUp.new([self])
end

#to_sql(engine = Arel::Table.engine) ⇒ Object



308
309
310
311
312
# File 'lib/arel_extensions.rb', line 308

def to_sql(engine = Arel::Table.engine)
  collector = Arel::Collectors::SQLString.new
  collector = engine.connection.visitor.accept self, collector
  collector.value
end