mikael
1
Hello!
My problem is my :dependent => :destroy do not call the destroy method.
Why is it so?
Any sugesstions.
class Comment
belongs_to :commentable, :polymorphic => true,
end
class Article
has_many :comments, :as => ‘commentable’, :dependent => :destroy
end
mikael
2
In my opinion:
If you call delete method, then it will not call destroy method,
if you call destroy method, it will call destroy method.
i.e.
Article.destroy
it is the discrepancy between delete and destroy method.
mikael
3
In my opinion:
If you call delete method, then it will not call destroy method,
if you call destroy method, it will call destroy method.
i.e.
Article.destroy
it is the discrepancy between delete and destroy method.
On Fri, May 16, 2008 at 4:24 PM, Mikael Björkegren <
[email protected]> wrote:
class Article
has_many :comments, :as => ‘commentable’, :dependent => :destroy
end
Posted via http://www.ruby-forum.com/.
–
Nibirutech CTO Eric.Archangel
MSN: [email protected]
QQ: 996252
GMAIL: [email protected]
BLOG: archangel_新浪博客
Thanks for your reply.
But it do not call my destroy method for Comment, but it removes it
from my database. ?
Eric.Archangel wrote:
In my opinion:
If you call delete method, then it will not call destroy method,
if you call destroy method, it will call destroy method.
Article.destroy�