note's `noteable_id` issue when running on PostgreSQL
Created by: linjunpop
The log:
CACHE (0.0ms) SELECT COUNT(*) FROM "users_projects" WHERE "users_projects"."project_id" = 1 AND "users_projects"."user_id" = 2 AND "users_projects"."project_access" IN (40)
Note Load (0.7ms) SELECT "notes".* FROM "notes" WHERE "notes"."noteable_id" = 5 AND "notes"."noteable_type" = 'Issue'
PGError: ERROR: operator does not exist: character varying = integer
LINE 1: ...otes".* FROM "notes" WHERE "notes"."noteable_id" = 5 AND "n...
^
HINT: No operator matches the given name and argument type(s). You might need to add explicit type casts.
: SELECT "notes".* FROM "notes" WHERE "notes"."noteable_id" = 5 AND "notes"."noteable_type" = 'Issue'
Rendered issues/show.html.haml within layouts/project (11.0ms)
Completed 500 Internal Server Error in 24ms
ActionView::Template::Error (PGError: ERROR: operator does not exist: character varying = integer
LINE 1: ...otes".* FROM "notes" WHERE "notes"."noteable_id" = 5 AND "n...
^
HINT: No operator matches the given name and argument type(s). You might need to add explicit type casts.
: SELECT "notes".* FROM "notes" WHERE "notes"."noteable_id" = 5 AND "notes"."noteable_type" = 'Issue'):
16:
17: %br
18: - if @issue.upvotes > 0
19: .upvotes#upvotes= "+#{pluralize @issue.upvotes, 'upvote'}"
20:
21:
22: .back_link
app/models/issue.rb:51:in `upvotes'
app/views/issues/show.html.haml:19:in `_app_views_issues_show_html_haml___527772461796785531_54232600'
app/controllers/issues_controller.rb:61:in `show'