Is there any way to destroy dependencies only after checking condition? This is my Model subject_type.rb
class SubjectType < ActiveRecord::Base
has_many :subjects, :dependent=>:destroy
validates_presence_of :name
end
If subject_type_id is present in subject table , dependency should not work,