I am working in an Rails app, i am aware of :dependent => delete_all
functionality in a Model.
Consider the below example
class TableA < ActiveRecord::Base
has_many :tablebs, :dependent => :delete_all
end
class TableB < ActiveRecord::Base
belongs_to :tablea
end
If there is corresponding foreign key reference in TableB which represents TableA, then deleting record in TableA using Active record will delete all the corresponding rows in TableB.
But when there is no corresponding values in TableB, it shows like
uninitialized constant TableA::TableB
What i am trying to achieve is, the Active Record should delete dependent values if its present and ignore the step if there is no dependent values.
Is this possible?
thanks, Balan