lml/commontator

When i enable metion true then an error come related to username i am not finding the query where username is declared

Opened this issue · 1 comments

ser Load (0.8ms) SELECT "users".* FROM "users" WHERE (username LIKE '%') AND "users"."id" IS NULL
Completed 500 Internal Server Error in 1696ms (ActiveRecord: 6.3ms | Allocations: 76570)

ActiveRecord::StatementInvalid (PG::UndefinedColumn: ERROR: column "username" does not exist
LINE 1: SELECT "users".* FROM "users" WHERE (username LIKE '%') AND ...
^
):

activerecord (7.0.3.1) lib/active_record/connection_adapters/postgresql_adapter.rb:768:in exec_params' activerecord (7.0.3.1) lib/active_record/connection_adapters/postgresql_adapter.rb:768:in block (2 levels) in exec_no_cache'
activesupport (7.0.3.1) lib/active_support/concurrency/share_lock.rb:187:in `yield_shares'

It's in the initializer. The default is here:

config.user_mentions_proc = ->(current_user, thread, query) do
current_user.class.where('username LIKE ?', "#{query}%")
end

If you use a different column, simply change the block accordingly.