Commit d45766c1 by Rocky Duan

shift recalculation to content

parent 88f99b59
...@@ -49,7 +49,7 @@ namespace :db do ...@@ -49,7 +49,7 @@ namespace :db do
task :clean => :environment do task :clean => :environment do
Comment.delete_all Comment.delete_all
CommentThread.delete_all CommentThread.delete_all
CommentThread.recalculate_all_context_tag_weights! Content.recalculate_all_context_tag_weights!
User.delete_all User.delete_all
Notification.delete_all Notification.delete_all
Subscription.delete_all Subscription.delete_all
...@@ -156,7 +156,7 @@ namespace :db do ...@@ -156,7 +156,7 @@ namespace :db do
Comment.delete_all Comment.delete_all
CommentThread.delete_all CommentThread.delete_all
CommentThread.recalculate_all_context_tag_weights! Content.recalculate_all_context_tag_weights!
User.delete_all User.delete_all
Notification.delete_all Notification.delete_all
Subscription.delete_all Subscription.delete_all
......
...@@ -137,7 +137,7 @@ describe "app" do ...@@ -137,7 +137,7 @@ describe "app" do
end end
describe "GET /api/v1/threads/tags" do describe "GET /api/v1/threads/tags" do
it "get all tags used in threads" do it "get all tags used in threads" do
CommentThread.recalculate_all_context_tag_weights! Content.recalculate_all_context_tag_weights!
thread1 = CommentThread.all.to_a.first thread1 = CommentThread.all.to_a.first
thread2 = CommentThread.all.to_a.last thread2 = CommentThread.all.to_a.last
thread1.tags = "a, b, c" thread1.tags = "a, b, c"
...@@ -162,7 +162,7 @@ describe "app" do ...@@ -162,7 +162,7 @@ describe "app" do
end end
it "returns autocomplete results" do it "returns autocomplete results" do
CommentThread.delete_all CommentThread.delete_all
CommentThread.recalculate_all_context_tag_weights! Content.recalculate_all_context_tag_weights!
create_comment_thread "c++, clojure, common-lisp, c#, c, coffeescript" create_comment_thread "c++, clojure, common-lisp, c#, c, coffeescript"
create_comment_thread "c++, clojure, common-lisp, c#, c" create_comment_thread "c++, clojure, common-lisp, c#, c"
create_comment_thread "c++, clojure, common-lisp, c#" create_comment_thread "c++, clojure, common-lisp, c#"
......
...@@ -37,7 +37,7 @@ end ...@@ -37,7 +37,7 @@ end
def init_without_subscriptions def init_without_subscriptions
Comment.delete_all Comment.delete_all
CommentThread.delete_all CommentThread.delete_all
CommentThread.recalculate_all_context_tag_weights! Content.recalculate_all_context_tag_weights!
User.delete_all User.delete_all
Notification.delete_all Notification.delete_all
Subscription.delete_all Subscription.delete_all
...@@ -110,7 +110,7 @@ end ...@@ -110,7 +110,7 @@ end
def init_with_subscriptions def init_with_subscriptions
Comment.delete_all Comment.delete_all
CommentThread.delete_all CommentThread.delete_all
CommentThread.recalculate_all_context_tag_weights! Content.recalculate_all_context_tag_weights!
User.delete_all User.delete_all
Notification.delete_all Notification.delete_all
Subscription.delete_all Subscription.delete_all
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment