GitHub Sale: sign up for any paid plan this week and pay nothing until January 1, 2009!  [ hide ]

public
Description: DataMapper Adapters
Homepage: http://www.yehudakatz.com
Clone URL: git://github.com/wycats/dm-adapters.git
wycats (author)
Tue May 13 18:52:11 -0700 2008
commit  4adb2e64fb049b4e13ded3fae3bbbe0658438314
tree    227b586363d9b83fac27f5d96f900cea2411ae25
parent  a7bd92d1e8cf39ed1831324636db742eb07df8ac
dm-adapters / salesforce
name age message
..
file LICENSE Tue May 13 16:06:43 -0700 2008 Salesforce adapter becomes a gem [wycats]
file README.markdown Tue May 13 16:06:43 -0700 2008 Salesforce adapter becomes a gem [wycats]
file Rakefile Tue Nov 25 15:02:16 -0800 2008 New version is 0.9.7.2 [halorgium]
file dm-salesforce.gemspec Tue Nov 25 15:02:16 -0800 2008 New version is 0.9.7.2 [halorgium]
directory lib/ Tue Nov 25 14:59:23 -0800 2008 Fix the general create/update/delete exception [halorgium]
directory spec/ Thu Nov 13 13:38:23 -0800 2008 A large refactor of the 2 components: dm-salesf... [halorgium]
README.markdown

dm-salesforce

A gem that provides a Salesforce Adapter for DataMapper.

The URI for a Salesforce repository is:

salesforce://username:password@salesforce.wsdl # relative wsdl path
salesforce://username:password@/etc/salesforce.wsdl # absolute wsdl path

The wsdl is converted into Ruby classes and stored in ~/.salesforce. This automatically happens the first time you use the salesforce adapter, so you don’t need to worry about generating Ruby code. It just works.

An example of using the adapter:

class Account
  include DataMapper::Resource

  property :id, String, :key => true
  property :name, String
  property :description, String
  property :billing_city, String
  property :billing_postal_code, String
  property :billing_country, String
  property :billing_state, String
  property :billing_street, String
  property :fax, String
  property :phone, String
  property :type, String
  property :website, String
  has n, :contacts
end

class Contact
  include DataMapper::Resource

  property :id, String, :key => true
  property :title, String
  property :email, String
  property :first_name, String
  property :last_name, String
  property :home_phone, String
  property :mobile_phone, String
  property :phone, String
  belongs_to :account
end

You can then do Contact.all("account.name.like" => "%ruby%"), which will get a list of all contacts whose associated account’s name is like %ruby%.