Class: WorkflowKit::MarkAsDeceasedBrick

Inherits:
Brick
  • Object
show all
Defined in:
app/models/workflow_kit/mark_as_deceased_brick.rb

Instance Method Summary collapse

Instance Method Details

#descriptionObject



6
7
8
# File 'app/models/workflow_kit/mark_as_deceased_brick.rb', line 6

def description
  "Move the user to the deceased status in all his corporations. Remove other group memberships. Set the date-of-death profile field. Deactivate user account."
end

#execute(params) ⇒ Object



9
10
11
12
13
14
15
# File 'app/models/workflow_kit/mark_as_deceased_brick.rb', line 9

def execute( params )
  raise 'no user_id given' unless params[:user_id] 
  raise 'no localized_date_of_death given' unless params[:localized_date_of_death]
  user = User.find(params[:user_id])
  date_of_death = params[:localized_date_of_death].to_date
  user.mark_as_deceased at: date_of_death
end

#nameObject



3
4
5
# File 'app/models/workflow_kit/mark_as_deceased_brick.rb', line 3

def name
  "Mark User as Deceased"
end