Skip to content

ActiveRecord::StatementInvalid in Thredded::MessageboardsController#index #822

@toommz

Description

@toommz

Hi,

On a Rails 6 rc2 project, when attempting to access forum index, I'm encountering the following error :

PG::UndefinedTable: ERROR: missing FROM-clause entry for table "thredded_topics"

The generated SQL is:

"SELECT "thredded_messageboards".* FROM "thredded_messageboards" LEFT OUTER JOIN "thredded_user_topic_read_states" ON "thredded_messageboards"."id" = "thredded_user_topic_read_states"."messageboard_id" AND "thredded_user_topic_read_states"."postable_id" = "thredded_topics"."id" AND "thredded_user_topic_read_states"."user_id" IS NULL AND "thredded_user_topic_read_states"."unread_posts_count" = 0 INNER JOIN "thredded_topics" ON "thredded_topics"."messageboard_id" = "thredded_messageboards"."id" WHERE ("thredded_topics"."moderation_state" != 2 OR "thredded_topics"."user_id" IS NULL) GROUP BY "thredded_messageboards"."id""

I tried to find a solution but quickly got lost with all those arel tables in this class method

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions