capsule_crm icon indicating copy to clipboard operation
capsule_crm copied to clipboard

Task category does not get serialized

Open mattbeedle opened this issue 10 years ago • 1 comments

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

mattbeedle avatar Sep 17 '14 13:09 mattbeedle

Ok, actually task categories do get saved. The issue is actually #reload which needs to go through the same deserialisation as the .find

mattbeedle avatar Jan 24 '15 12:01 mattbeedle