dependent destroy, only the foreign key
has_one :credit_card, dependent: :destroy # destroys the associated credit card has_one :credit_card, dependent: :nullify # updates the associated records foreign # key value to NULL rather than destroying it has_one :last_comment, -> { order('posted_on') }, class_name: "Comment" has_one :project_manager, -> { where(role: 'project_manager') }, class_name: "Person" has_one :attachment, as: :attachable has_one :boss, -> { readonly } has_one :club, through: :membership has_one :primary_address, -> { where(primary: true) }, through: :addressables, source: :addressable has_one :credit_card, required: true
Source: apidock.com