Award Emoji cannot be added to Merge Requests
Attempting to add an Award Emoji to a Merge Request causes a 500 error:
PG::UndefinedColumn: ERROR: column merge_requests.project does not exist
LINE 1: ...e_requests" WHERE "merge_requests"."id" = 50 AND "merge_req...
^
: SELECT "merge_requests".* FROM "merge_requests" WHERE "merge_requests"."id" = 50 AND "merge_requests"."project" = 5 ORDER BY "merge_requests"."id" DESC LIMIT 1
Completed 500 Internal Server Error in 51ms (ActiveRecord: 6.4ms)
PG::UndefinedColumn - ERROR: column merge_requests.project does not exist
LINE 1: ...e_requests" WHERE "merge_requests"."id" = 50 AND "merge_req...
^
:
activerecord (4.1.12) lib/active_record/connection_adapters/postgresql_adapter.rb:822:in `block in exec_no_cache'
activerecord (4.1.12) lib/active_record/connection_adapters/abstract_adapter.rb:378:in `block in log'
activesupport (4.1.12) lib/active_support/notifications/instrumenter.rb:20:in `instrument'
activerecord (4.1.12) lib/active_record/connection_adapters/abstract_adapter.rb:372:in `log'
activerecord (4.1.12) lib/active_record/connection_adapters/postgresql_adapter.rb:822:in `exec_no_cache'
activerecord (4.1.12) lib/active_record/connection_adapters/postgresql/database_statements.rb:137:in `exec_query'
activerecord (4.1.12) lib/active_record/connection_adapters/postgresql_adapter.rb:954:in `select'
activerecord (4.1.12) lib/active_record/connection_adapters/abstract/database_statements.rb:24:in `select_all'
activerecord (4.1.12) lib/active_record/connection_adapters/abstract/query_cache.rb:68:in `block in select_all'
activerecord (4.1.12) lib/active_record/connection_adapters/abstract/query_cache.rb:83:in `cache_sql'
activerecord (4.1.12) lib/active_record/connection_adapters/abstract/query_cache.rb:68:in `select_all'
activerecord (4.1.12) lib/active_record/querying.rb:39:in `find_by_sql'
activerecord (4.1.12) lib/active_record/relation.rb:611:in `exec_queries'
activerecord (4.1.12) lib/active_record/relation.rb:493:in `load'
activerecord (4.1.12) lib/active_record/relation.rb:238:in `to_a'
activerecord (4.1.12) lib/active_record/relation/finder_methods.rb:460:in `find_take'
activerecord (4.1.12) lib/active_record/relation/finder_methods.rb:98:in `take'
activerecord (4.1.12) lib/active_record/relation/finder_methods.rb:104:in `take!'
activerecord (4.1.12) lib/active_record/relation/finder_methods.rb:87:in `find_by!'
activerecord (4.1.12) lib/active_record/querying.rb:7:in `find_by!'
app/controllers/projects/notes_controller.rb:63:in `award_toggle'
... rest of stack trace
This is because we're calling find_by!
on MergeRequest
with a project
argument, which of course doesn't exist on MergeRequest
.
This must be fixed for the official 8.2 release.