diff --git a/app/models/inferred_concept_post.rb b/app/models/inferred_concept_post.rb index 60fb58ba..cf1d0077 100644 --- a/app/models/inferred_concept_post.rb +++ b/app/models/inferred_concept_post.rb @@ -1,8 +1,6 @@ # frozen_string_literal: true class InferredConceptPost < ActiveRecord::Base - self.table_name = "inferred_concepts_posts" - belongs_to :inferred_concept belongs_to :post @@ -13,7 +11,7 @@ end # == Schema Information # -# Table name: inferred_concepts_posts +# Table name: inferred_concept_posts # # inferred_concept_id :bigint # post_id :bigint @@ -22,6 +20,6 @@ end # # Indexes # -# index_inferred_concepts_posts_on_inferred_concept_id (inferred_concept_id) -# index_inferred_concepts_posts_uniqueness (post_id,inferred_concept_id) UNIQUE +# index_inferred_concept_posts_on_inferred_concept_id (inferred_concept_id) +# index_inferred_concept_posts_uniqueness (post_id,inferred_concept_id) UNIQUE # diff --git a/app/models/inferred_concept_topic.rb b/app/models/inferred_concept_topic.rb index 22fc401e..0ac8429f 100644 --- a/app/models/inferred_concept_topic.rb +++ b/app/models/inferred_concept_topic.rb @@ -1,8 +1,6 @@ # frozen_string_literal: true class InferredConceptTopic < ActiveRecord::Base - self.table_name = "inferred_concepts_topics" - belongs_to :inferred_concept belongs_to :topic @@ -13,7 +11,7 @@ end # == Schema Information # -# Table name: inferred_concepts_topics +# Table name: inferred_concept_topics # # inferred_concept_id :bigint # topic_id :bigint @@ -22,6 +20,6 @@ end # # Indexes # -# index_inferred_concepts_topics_on_inferred_concept_id (inferred_concept_id) -# index_inferred_concepts_topics_uniqueness (topic_id,inferred_concept_id) UNIQUE +# index_inferred_concepts_topic_on_inferred_concept_id (inferred_concept_id) +# index_inferred_concepts_topic_uniqueness (topic_id,inferred_concept_id) UNIQUE # diff --git a/lib/inferred_concepts/finder.rb b/lib/inferred_concepts/finder.rb index a853b311..37880802 100644 --- a/lib/inferred_concepts/finder.rb +++ b/lib/inferred_concepts/finder.rb @@ -79,7 +79,7 @@ module DiscourseAi # Exclude topics that already have concepts topics_with_concepts = <<~SQL SELECT DISTINCT topic_id - FROM inferred_concepts_topics + FROM inferred_concept_topics SQL query = query.where("topics.id NOT IN (#{topics_with_concepts})") @@ -129,7 +129,7 @@ module DiscourseAi # Exclude posts that already have concepts posts_with_concepts = <<~SQL SELECT DISTINCT post_id - FROM inferred_concepts_posts + FROM inferred_concept_posts SQL query = query.where("posts.id NOT IN (#{posts_with_concepts})")