Sha256: ff4efd131c827bf0d8c2f450989bc779ca735f7daa0769b6e2a97b3560fa9d05

Contents?: true

Size: 556 Bytes

Versions: 39

Compression:

Stored size: 556 Bytes

Contents

class Openall_time_applet::Models::Organisation < Knj::Datarow
  def self.update_cache(d, args)
    res = nil
    args[:oata].oa_conn do |conn|
      res = conn.request(:getAllOrganisationsForUser)
    end
    
    res.each do |org_data|
      org = self.ob.get_by(:Organisation, {"openall_uid" => org_data["uid"]})
      org_data = {
        :openall_uid => org_data["uid"],
        :name => org_data["name"]
      }
      
      if org
        org.update(org_data)
      else
        org = self.ob.add(:Organisation, org_data)
      end
    end
  end
end

Version data entries

39 entries across 39 versions & 1 rubygems

Version Path
openall_time_applet-0.0.45 models/organisation.rb
openall_time_applet-0.0.44 models/organisation.rb
openall_time_applet-0.0.43 models/organisation.rb
openall_time_applet-0.0.42 models/organisation.rb
openall_time_applet-0.0.41 models/organisation.rb
openall_time_applet-0.0.40 models/organisation.rb
openall_time_applet-0.0.38 models/organisation.rb
openall_time_applet-0.0.37 models/organisation.rb
openall_time_applet-0.0.36 models/organisation.rb
openall_time_applet-0.0.35 models/organisation.rb
openall_time_applet-0.0.34 models/organisation.rb
openall_time_applet-0.0.33 models/organisation.rb
openall_time_applet-0.0.32 models/organisation.rb
openall_time_applet-0.0.31 models/organisation.rb
openall_time_applet-0.0.30 models/organisation.rb
openall_time_applet-0.0.29 models/organisation.rb
openall_time_applet-0.0.28 models/organisation.rb
openall_time_applet-0.0.27 models/organisation.rb
openall_time_applet-0.0.26 models/organisation.rb
openall_time_applet-0.0.25 models/organisation.rb