ActiveSalesforce and Ruby on Rails > 2.1

July 9th, 2008 by Justin Ball

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.

Tags:   · · · · · 4 Comments

Leave A Comment

4 responses so far ↓

  • 1 Joshua Hoskins Jul 14, 2008 at 7:49 am

    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.

  • 2 Justin Ball Jul 14, 2008 at 9:15 am

    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.

  • 3 Senthil Nayagam Aug 8, 2008 at 7:29 pm

    Hi Justin,

    I have applied the patch and added a gemspec

    http://github.com/luigi/activerecord-activesalesforce-adapter/tree/master

    regards
    Senthil

  • 4 Justin Ball Aug 13, 2008 at 2:15 pm

    This is great to hear. Thanks for updating the gem.