ActiveSalesforce and Ruby on Rails > 2.1

by Justin Ball on July 9th, 2008

We have to do an integration with Saleforce for a Rails project we are working on. I keep getting this error:

The :dependent option expects either :destroy or :delete (:nullify)

I posted to the Salesforce forums and didn't get any response so I did some more investigation. Turns out there is a bug and a patch:

http://rubyforge.org/tracker/index.php?func=detail&aid=19960&group_id=1201&atid=4729

Lucky for me the latest version of Rails has a feature that unpacks all of your gems into your vendor directory. I unpacked activesalesforce, made the code changes by applying the patch (which just removes :dependent => :nullify) and viola.

  • This is great to hear. Thanks for updating the gem.
  • Hi Justin,

    I have applied the patch and added a gemspec

    http://github.com/luigi/activerecord-activesale...

    regards
    Senthil
  • Be sure to add this code:

    config.gem 'activerecord-activesalesforce-adapter', :lib => 'active_record', :version => '2.0.0'


    inside of

    Rails::Initializer.run do |config|


    in the environment.rb file.
  • Joshua Hoskins
    Thanks for the post I really appreciate it. Did you get the GEM to unpack successfully?
    rake gems:unpack GEM=activerecord-activesalesforce-adapter outputs nothing for me.
blog comments powered by Disqus