capsule_crm
capsule_crm copied to clipboard
Task category does not get serialized
Unless I've been smoking too much crack, it seems that task categories don't get saved, and they never ever worked.
t = CapsuleCRM::Task.new(
description: 'Fix the crappy tasks code', category: 'Follow-up', due_date_time: Time.now
)
# => #<CapsuleCRM::Task:70274750222480 id: , due_date: , due_date_time: 2014-09-17T15:01:59+02:00, description: Fix the crappy tasks code, detail: , party_id: , opportunity_id: , case_id: , owner_id: , category_id: >
t.to_capsule_json
# => {"task"=>{"dueDateTime"=>"2014-09-17T15:02:08Z", "description"=>"Fix the crappy tasks code"}}
t.save
t.category # => "Follow-up"
t.reload
t.category # => nil
Ok, actually task categories do get saved. The issue is actually #reload
which needs to go through the same deserialisation as the .find