Class: LesliLetter::NotebookService

Inherits:
Lesli::ApplicationLesliService
  • Object
show all
Defined in:
app/services/lesli_letter/notebook_service.rb

Instance Method Summary collapse

Instance Method Details

#find(id) ⇒ Object



36
37
38
39
# File 'app/services/lesli_letter/notebook_service.rb', line 36

def find id 
    self.resource = current_user..roles.find_by_id(id)
    self
end

#indexArray

Returns Paginated index of users.

Returns:

  • (Array)

    Paginated index of users.



44
45
46
47
48
49
50
# File 'app/services/lesli_letter/notebook_service.rb', line 44

def index 
    current_user..letter.notebooks
    .select(:id, :name, :description)
    .page(query[:pagination][:page])
    .per(query[:pagination][:perPage])
    .order(updated_at: :desc, name: :asc)
end