Sha256: a649cf3e2047a8fb846683383412daaf2f17fbc098b74e0bfec461850af32d56

Contents?: true

Size: 740 Bytes

Versions: 10

Compression:

Stored size: 740 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": "#{@sugar_session_id}",
        "module_names": "#{module_names.to_json}",
        "module_ids": #{module_ids.to_json},
        "link_field_names": #{link_field_names.to_json},
        "related_ids": #{related_ids.to_json}   
      }
    EOF
    json.gsub!(/^\s{6}/,'')
    send!(:set_relationships, json)
  end
end; end

Version data entries

10 entries across 10 versions & 2 rubygems

Version Path
sugarcrm_emp-0.10.5 lib/sugarcrm/connection/api/set_relationships.rb
sugarcrm_emp-0.10.1 lib/sugarcrm/connection/api/set_relationships.rb
sugarcrm_emp-0.10.0 lib/sugarcrm/connection/api/set_relationships.rb
sugarcrm-0.9.18 lib/sugarcrm/connection/api/set_relationships.rb
sugarcrm-0.9.17 ./lib/sugarcrm/connection/api/set_relationships.rb
sugarcrm-0.9.16 ./lib/sugarcrm/connection/api/set_relationships.rb
sugarcrm-0.9.15 ./lib/sugarcrm/connection/api/set_relationships.rb
sugarcrm-0.9.14 ./lib/sugarcrm/connection/api/set_relationships.rb
sugarcrm-0.9.13 ./lib/sugarcrm/connection/api/set_relationships.rb
sugarcrm-0.9.12 ./lib/sugarcrm/connection/api/set_relationships.rb