Rails :dependent => :destroy VS :dependent => :delete_all

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. 4 Answers 4

What is causing this ActiveRecord::ReadOnlyRecord error?

This follows this prior question, which was answered. I actually discovered I could remove a join from that query, so now the working query is start_cards = DeckCard.find :all, :joins => [:card], :conditions => [“deck_cards.deck_id = ? and cards.start_card = ?”, @game.deck.id, true] This appears to work. However, when I try to move these DeckCards … Read more

What is the difference between association, aggregation and composition?

What is the difference between association, aggregation, and composition? Please explain in terms of implementation. 20 s 20 For two objects, Foo and Bar the relationships can be defined Association – I have a relationship with an object. Foo uses Bar public class Foo { private Bar bar; }; NB: See Fowler’s definition – the … Read more