Method: Caprese::Query#record_scope

Defined in:
lib/caprese/controller/concerns/query.rb

#record_scope(type) ⇒ Relation

Note:

We use the term scope, because the collection may be all records of that type, or the records may be scoped further by overriding this method

Gets a collection of type type, providing the collection as a ‘record scope` by which to query records

Parameters:

  • type (Symbol)

    the type to get a record scope for

Returns:

  • (Relation)

    the scope of records of type type



86
87
88
# File 'lib/caprese/controller/concerns/query.rb', line 86

def record_scope(type)
  record_class(type).all
end