class EagerGroup::Definition
Attributes
association[R]
column_name[R]
scope[R]
Public Class Methods
new(association, aggregate_function, column_name, scope)
click to toggle source
# File lib/eager_group/definition.rb, line 7 def initialize(association, aggregate_function, column_name, scope) @association = association @aggregate_function = aggregate_function @column_name = column_name @scope = scope end
Public Instance Methods
aggregation_function()
click to toggle source
# File lib/eager_group/definition.rb, line 14 def aggregation_function return :maximum if @aggregate_function.to_sym == :last_object return :minimum if @aggregate_function.to_sym == :first_object @aggregate_function end
default_value()
click to toggle source
# File lib/eager_group/definition.rb, line 25 def default_value %i[first_object last_object].include?(@aggregate_function.to_sym) ? nil : 0 end
need_load_object()
click to toggle source
# File lib/eager_group/definition.rb, line 21 def need_load_object %i[first_object last_object].include?(@aggregate_function.to_sym) end