Sha256: 58524844d6e545371f1bb094aaa9d791073b65b2763852aad4af89f01f660be3

Contents?: true

Size: 753 Bytes

Versions: 5

Compression:

Stored size: 753 Bytes

Contents

module SugarCRM; class Connection
  # Sets multiple relationships between two SugarBeans.
  def set_relationships(module_names, module_ids, link_field_names, related_ids)
    login! unless logged_in?
    
    [module_names, module_ids, link_field_names, related_ids].each do |arg|
      raise ArgumentError, "argument must be an Array" unless arg.class == Array
    end
    
    json = <<-EOF
      {
        \"session\": \"#{@session}\"\,
        \"module_names\": \"#{module_names.to_json}\"\,
        \"module_ids\": #{module_ids.to_json}\,
        \"link_field_names\": #{link_field_names.to_json}\,
        \"related_ids\": #{link_field_name.to_json}   
      }
    EOF
    json.gsub!(/^\s{6}/,'')
    send!(:set_relationships, json)
  end
end; end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
sugarcrm-0.8.0 lib/sugarcrm/connection/api/set_relationships.rb
sugarcrm-0.7.9 lib/sugarcrm/connection/api/set_relationships.rb
sugarcrm-0.7.8 lib/sugarcrm/connection/api/set_relationships.rb
sugarcrm-0.7.7 lib/sugarcrm/connection/api/set_relationships.rb
sugarcrm-0.7.2 lib/sugarcrm/connection/api/set_relationships.rb