Class: ActiveRecord::Refined::AST::WindowFunction

Inherits:
Function
  • Object
show all
Defined in:
lib/active_record/refined/ast.rb

Overview

ROW_NUMBER and its kind: functions that say nothing without a window. On its own this refuses rather than reaching the database as an error there; over asks it for call_arel instead.

Instance Attribute Summary

Attributes inherited from Function

#args, #name

Instance Method Summary collapse

Methods inherited from Function

#initialize

Methods included from Windowing

#over

Methods included from Arithmetics

#&, #*, #+, #-, #/, #<<, #>>, #^, #|, #~

Methods included from Predications

#!=, #!~, #<, #<=, #==, #=~, #>, #>=, #between?, #bury, #casecmp?, #contains?, #dig, #dig_json, #distinct_from?, #end_with?, #false?, #ilike?, #in?, #include?, #intersect?, #key?, #like?, #member?, #not_between?, #not_distinct_from?, #not_false?, #not_ilike?, #not_in?, #not_like?, #not_null?, #not_true?, #null?, #start_with?, #subset?, #superset?, #true?, #when

Methods inherited from Node

#as, #asc, #desc

Constructor Details

This class inherits a constructor from ActiveRecord::Refined::AST::Function

Instance Method Details

#call_arelObject



1053
# File 'lib/active_record/refined/ast.rb', line 1053

alias_method :call_arel, :to_arel

#to_arel(_table, _model) ⇒ Object

Raises:

  • (ArgumentError)


1055
1056
1057
# File 'lib/active_record/refined/ast.rb', line 1055

def to_arel(_table, _model)
  raise ArgumentError, "#{name.downcase} is a window function; it needs over"
end