Method: Model#roots

Defined in:
lib/yodel/models/core/model/model.rb

#rootsObject

Scope to retrieve all root records of a model type under a site, e.g Groups.roots(site). Returns all records with a nil parent.



135
136
137
# File 'lib/yodel/models/core/model/model.rb', line 135

def roots
  self.where(parent: nil).order('index asc')
end