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:
https://github.com/rails/rails/pull/7188/files

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:

https://github.com/rails/rails/blob/4b4aeabb3605bd0cbd7dde10c1d2ac990c65379a/activerecord/lib/active_record/associations.rb#L988

(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: http://stackoverflow.com/a/16329482/178651

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