Class: MemberTask

Inherits:
ApplicationRecord show all
Defined in:
app/models/members/member_task.rb

Constant Summary collapse

TASKS =
{
  code: 0,
  ci: 1,
  issues: 2
}.freeze

Constants inherited from ApplicationRecord

ApplicationRecord::MAX_PLUCK

Instance Method Summary collapse

Methods inherited from ApplicationRecord

cached_column_list, #create_or_load_association, declarative_enum, default_select_columns, id_in, id_not_in, iid_in, pluck_primary_key, primary_key_in, #readable_by?, safe_ensure_unique, safe_find_or_create_by, safe_find_or_create_by!, #to_ability_name, underscore, where_exists, where_not_exists, with_fast_read_statement_timeout, without_order

Methods included from SensitiveSerializableHash

#serializable_hash

Instance Method Details

#tasks_to_be_doneObject


20
21
22
# File 'app/models/members/member_task.rb', line 20

def tasks_to_be_done
  Array(self[:tasks]).map { |task| TASKS.key(task) }
end

#tasks_to_be_done=(tasks) ⇒ Object


24
25
26
27
28
# File 'app/models/members/member_task.rb', line 24

def tasks_to_be_done=(tasks)
  self[:tasks] = Array(tasks).map do |task|
    TASKS[task.to_sym]
  end.uniq
end