Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
DF-anuj opened this issue Jul 20, 2023 · 1 comment

Comments

@DF-anuj
Copy link

DF-anuj commented Jul 20, 2023

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'

@Dantemss
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants