has_many doc inconsistency/missing info in upgrade doc related to dependent option behavior change from Rails 3 to 4

A team member just found the following out about an inconsistency in the Rails documentation. Although:

indicates for the dependent option: “When no option is given, the behaviour is to do nothing with the associated records when destroying a record.”

Which is consistent with the behavior, but in:

(in the rdoc for associations), it states: “The default strategy is :nullify (set the foreign keys to nil), except for has_many :through, where the default strategy is delete_all (delete the join records, without running their callbacks).”

I think that last statement is a little unclear since it is no longer accurate in Rails 4, it seems. Magne on S.O. also noted this in the first comment of this answer: What are the default values for Rails 3 for :dependent on has_many and belongs_to - Stack Overflow

In addition, that might be helpful to mention somewhere in guides/source/upgrading_ruby_on_rails.md?

I’m not sure how to summarize/clarify that behavior at the moment in associations.rb (would just removing the sentence about the default strategy be ok?) or in which places “dependent: :nullify” should be added to models to ensure similar behavior from Rails 3 to 4 for the upgrade doc. Any ideas?

Hi,

I’m new here, but I believe you should open an issue over at github. Then people could reference it for possible pull requests + it would be more visible if somebody searches for it.

Just my 2 cents.

Cheers