lml / commontator

A Rails engine for comments
MIT License
354 stars 99 forks source link

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 1 year ago

DF-anuj commented 1 year ago

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:inblock (2 levels) in exec_no_cache' activesupport (7.0.3.1) lib/active_support/concurrency/share_lock.rb:187:in `yield_shares'

Dantemss commented 1 year ago

It's in the initializer. The default is here: https://github.com/lml/commontator/blob/856ff205ffbbb0c32aab39afe5fce3da958c650f/config/initializers/commontator.rb#L100-L102

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