You should be using dependent: :destroy
class LandOwner < ActiveRecord::Base
has_many :houses, dependent: :destroy
Then you can do @landowner.destroy
,which would delete all the houses that are associated with that landowner.
From the Guides, :nullify
causes the foreign keys to be set to NULL.While :destroy
causes all the associated objects to also be destroyed.