app/models/inkwell/comment.rb in inkwell-0.0.1 vs app/models/inkwell/comment.rb in inkwell-0.0.3

- old
+ new

@@ -1,7 +1,8 @@ module Inkwell class Comment < ActiveRecord::Base + attr_accessible :body, :post_id, :parent_id attr_accessor :is_reblogged attr_accessor :is_favorited attr_accessor :item_id_in_line attr_accessor :is_reblog_in_blogline attr_accessor :from_sources_in_timeline @@ -61,12 +62,12 @@ child_comments_ids_to_deleted << comment['comment_id'] end ::Inkwell::Comment.delete child_comments_ids_to_deleted comment_with_child_comments_ids_to_deleted = child_comments_ids_to_deleted << self.id - ::Inkwell::TimelineItem.destroy_all :item_id => comment_with_child_comments_ids_to_deleted, :is_comment => true - ::Inkwell::FavoriteItem.destroy_all :item_id => comment_with_child_comments_ids_to_deleted, :is_comment => true - ::Inkwell::BlogItem.destroy_all :item_id => comment_with_child_comments_ids_to_deleted, :is_comment => true + ::Inkwell::TimelineItem.delete_all :item_id => comment_with_child_comments_ids_to_deleted, :is_comment => true + ::Inkwell::FavoriteItem.delete_all :item_id => comment_with_child_comments_ids_to_deleted, :is_comment => true + ::Inkwell::BlogItem.delete_all :item_id => comment_with_child_comments_ids_to_deleted, :is_comment => true user_id = self.send("#{::Inkwell::Engine::config.user_table.to_s.singularize}_id") comment_with_child_comments_info = child_comments << Hash['user_id' => user_id, 'comment_id' => self.id] remove_info_from_upper_comments comment_with_child_comments_info