Skip to content
This repository was archived by the owner on Jul 22, 2025. It is now read-only.

Commit a8e1918

Browse files
committed
fix table name for rails convention
1 parent d9fc621 commit a8e1918

File tree

3 files changed

+8
-12
lines changed

3 files changed

+8
-12
lines changed
Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
# frozen_string_literal: true
22

33
class InferredConceptPost < ActiveRecord::Base
4-
self.table_name = "inferred_concepts_posts"
5-
64
belongs_to :inferred_concept
75
belongs_to :post
86

@@ -13,7 +11,7 @@ class InferredConceptPost < ActiveRecord::Base
1311

1412
# == Schema Information
1513
#
16-
# Table name: inferred_concepts_posts
14+
# Table name: inferred_concept_posts
1715
#
1816
# inferred_concept_id :bigint
1917
# post_id :bigint
@@ -22,6 +20,6 @@ class InferredConceptPost < ActiveRecord::Base
2220
#
2321
# Indexes
2422
#
25-
# index_inferred_concepts_posts_on_inferred_concept_id (inferred_concept_id)
26-
# index_inferred_concepts_posts_uniqueness (post_id,inferred_concept_id) UNIQUE
23+
# index_inferred_concept_posts_on_inferred_concept_id (inferred_concept_id)
24+
# index_inferred_concept_posts_uniqueness (post_id,inferred_concept_id) UNIQUE
2725
#
Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
# frozen_string_literal: true
22

33
class InferredConceptTopic < ActiveRecord::Base
4-
self.table_name = "inferred_concepts_topics"
5-
64
belongs_to :inferred_concept
75
belongs_to :topic
86

@@ -13,7 +11,7 @@ class InferredConceptTopic < ActiveRecord::Base
1311

1412
# == Schema Information
1513
#
16-
# Table name: inferred_concepts_topics
14+
# Table name: inferred_concept_topics
1715
#
1816
# inferred_concept_id :bigint
1917
# topic_id :bigint
@@ -22,6 +20,6 @@ class InferredConceptTopic < ActiveRecord::Base
2220
#
2321
# Indexes
2422
#
25-
# index_inferred_concepts_topics_on_inferred_concept_id (inferred_concept_id)
26-
# index_inferred_concepts_topics_uniqueness (topic_id,inferred_concept_id) UNIQUE
23+
# index_inferred_concepts_topic_on_inferred_concept_id (inferred_concept_id)
24+
# index_inferred_concepts_topic_uniqueness (topic_id,inferred_concept_id) UNIQUE
2725
#

lib/inferred_concepts/finder.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ def find_candidate_topics(
7979
# Exclude topics that already have concepts
8080
topics_with_concepts = <<~SQL
8181
SELECT DISTINCT topic_id
82-
FROM inferred_concepts_topics
82+
FROM inferred_concept_topics
8383
SQL
8484

8585
query = query.where("topics.id NOT IN (#{topics_with_concepts})")
@@ -129,7 +129,7 @@ def find_candidate_posts(
129129
# Exclude posts that already have concepts
130130
posts_with_concepts = <<~SQL
131131
SELECT DISTINCT post_id
132-
FROM inferred_concepts_posts
132+
FROM inferred_concept_posts
133133
SQL
134134

135135
query = query.where("posts.id NOT IN (#{posts_with_concepts})")

0 commit comments

Comments
 (0)