Method: Cellect::Server::GroupedWorkflow#group

Defined in:
lib/cellect/server/grouped_workflow.rb

#group(group_id = nil) ⇒ Object

Returns a group by id if the group_id is supplied it will select or setup this group when no group_id is supplied, it attempts to select a random group finally if no loaded groupes it falls back to creating a new empty group



19
20
21
22
23
24
25
26
# File 'lib/cellect/server/grouped_workflow.rb', line 19

def group(group_id = nil)
  group = if group_id
            fetch_or_setup_group(group_id)
          else
            subjects.values.sample
          end
  group || fetch_or_setup_group(group_id)
end