fix table name for rails convention

This commit is contained in:
Rafael Silva 2025-05-30 14:39:24 -03:00
parent d9fc621626
commit a8e19182ce
3 changed files with 8 additions and 12 deletions

View File

@ -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
#

View File

@ -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
#

View File

@ -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})")