Fun with ActiveRecord: given a User that `has_many :pants`, if you say: User.find(42).pants.delete_all It won't delete the pants, it'll just unset the user ID, orphaning the records: UPDATE "pants" SET "user_id" = null WHERE "pants"."user_id" = 42 Neat http://api.rubyonrails.org/classes/ActiveRecord/Associations/ClassMethods.html …
-
-
If you don't have `has_many :pants, dependent: :destroy` it will nullify by default - it honours the setting on the association.
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.