Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 778937
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T19:50:51+00:00 2026-05-14T19:50:51+00:00

In rails guides it’s described like this: Objects will be in addition destroyed if

  • 0

In rails guides it’s described like this:

Objects will be in addition destroyed if they’re associated with :dependent => :destroy, and deleted if they’re associated with :dependent => :delete_all

Right, cool. But what’s the difference between being destroyed and being deleted?
I tried both and it seems to do the same thing.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T19:50:52+00:00Added an answer on May 14, 2026 at 7:50 pm

    The difference is with the callback.

    The :delete_all is made directly in your application and deletes by SQL :

    DELETE * FROM users where compagny_id = XXXX
    

    With the :destroy, there is an instantiation of all of your children. So, if you can’t destroy it or if each has their own :dependent, its callbacks can be called.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Im reading the Rails guides for Rails 3 and they use this method: cattr_accessor
In the Rails guides they have this code to load a path. $LOAD_PATH <<
I am following this routing tutorial for Ruby on Rails: http://guides.rubyonrails.org/routing.html It says that
Looking at the Rails Guides http://guides.rubyonrails.org/testing.html#integration-testing-examples and this SO question Rails Functional Test of
Using this modified example from the Rails guides , how does one model a
the Rails Guides says: If there are missing precompiled files in production you will
Rails offer a functionality of passing variable to translation: http://guides.rubyonrails.org/i18n.html#passing-variables-to-translations I'd like to be
The rails docs are apparently in error - http://guides.rubyonrails.org/association_basics.html#selfjoins ) In designing a data
I'm reading these two pages resources Adding more RESTful actions The Rails Guides page
I have features I would like to be portable between my own Rails applications.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.