Method: Babik::QuerySet::AbstractBase#all

Defined in:
lib/babik/queryset.rb

#allResultSet

Return a ResultSet with the ActiveRecord objects that match the condition given by the filters.

Returns:

  • (ResultSet)

    ActiveRecord objects that match the condition given by the filters.



84
85
86
87
88
89
# File 'lib/babik/queryset.rb', line 84

def all
  sql_select = self.sql.select
  return @_projection.apply_transforms(self.class._execute_sql(sql_select)) if @_projection
  return @_select_related.all_with_related(self.class._execute_sql(sql_select)) if @_select_related
  @model.find_by_sql(sql_select)
end