Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ENV['BUNDLE_GEMFILE'] = "Gemfile"
- Bundler.setup
- require "dm-salesforce"
- DataMapper.setup(:salesforce, {:adapter => 'salesforce',
- :username => 'username',
- :password => 'password',
- :path => File.join("config", 'salesforce.wsdl'),
- :apidir => "tmp/dm-salesforce"
- })
- class Contact
- include DataMapper::Salesforce::Resource
- def self.default_repository_name
- :salesforce
- end
- property :id, Serial
- property :firstname, String, :field => "FirstName"
- property :lastname, String, :field => "LastName"
- property :home_phone, String, :field => "HomePhone"
- #property :account_id, Serial, :field => "AccountId"
- #belongs_to :account, :model => "Salesforce::Account"
- #belongs_to :master_contact, :model => "Salesforce::Contact"
- end
- Contact.all # => All my contacts - works well
- Contact.last.id # => "0032000000c8UUAAA2"
- Contact.get("0032000000bW9zAAAS") # => NameError: uninitialized constant DataMapper::Salesforce::Property
Add Comment
Please, Sign In to add comment