Class: WorkList

Inherits:
Object
  • Object
show all
Defined in:
app/models/work_list.rb

Overview

Encapsulate the logic for finding various lists of works

Extracted from the work class to stem the ever growing size of the Work Class

Class Method Summary collapse

Class Method Details

.completed_works(user, search_terms = nil) ⇒ Object



11
12
13
# File 'app/models/work_list.rb', line 11

def completed_works(user, search_terms = nil)
  works_by_user_state(user, "approved", search_terms)
end

.unfinished_works(user, search_terms = nil) ⇒ Object



7
8
9
# File 'app/models/work_list.rb', line 7

def unfinished_works(user, search_terms = nil)
  works_by_user_state(user, ["none", "draft", "awaiting_approval"], search_terms)
end

.withdrawn_works(user, search_terms = nil) ⇒ Object



15
16
17
# File 'app/models/work_list.rb', line 15

def withdrawn_works(user, search_terms = nil)
  works_by_user_state(user, "withdrawn", search_terms)
end