Sha256: 0a3a522d2a782c952710f2a608857030da9c5bbabe5beb1ecfc342b1d3054a09

Contents?: true

Size: 593 Bytes

Versions: 1

Compression:

Stored size: 593 Bytes

Contents

class Openall_time_applet::Models::Task < Knj::Datarow
  has_many [
    [:Timelog, :task_id, :timelogs]
  ]
  
  def self.update_cache(d, args)
    res = nil
    args[:oata].oa_conn do |conn|
      res = conn.request(:getAllTasksForUser)
    end
    
    res.each do |task_data|
      task = self.ob.get_by(:Task, {"openall_uid" => task_data["uid"]})
      task_data = {
        :openall_uid => task_data["uid"],
        :title => task_data["title"]
      }
      
      if task
        task.update(task_data)
      else
        task = self.ob.add(:Task, task_data)
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
openall_time_applet-0.0.2 models/task.rb