* Fix tests to run the searches for real instead of mocking everything out.
* Fix SavedSearch.populate to only use the read only database in
production because in breaks things in tests. Specifically:
the posts get created in one db connection but searched for in
another, but the second transaction doesn't see the uncommitted posts
in the first transaction, so the search doesn't work.
* Drop /posts?ro=true param (broken).
* Clean up tag_match (rescuing PG::ConnectionBad didn't do anything, we
just build the query here, we don't run it).
* Don't allow adding tags with invalid names when they already exist in
the tags table.
* If an invalid tag is added, show an warning and ignore the tag instead
of failing with a hard error.
* Move the _(cosplay) tag validation into the tag name validator.
Instead of having custom code check whether the artist name is already
in use, just enable autocomplete on the artist name field. This is an
easier and more robust way to indicate tag name conflicts.
Fixes an issue with zero downtime deployments (#4123). Hot restarting
didn't clear out BUNDLER_GEMFILE, which mean that new workers still used
the old Gemfile from previous deployments. This led to mysterious errors
with autoloading libraries (#4138).
Upgrade procedure:
$ echo 2.6.3 > .ruby-version
# upgrade ruby-build to know about the latest ruby versions.
# see also: github.com/rkh/rbenv-update
$ cd ~/.rbenv/plugins/ruby-build && git pull
# install the version of ruby specified in .ruby-version.
# see also: github.com/capistrano/rbenv/issues/83
$ rbenv install --skip-existing
# update the shell to use the latest version of ruby by default.
$ rbenv global 2.6.3
# update rubygems and bundler
$ gem update --system
# update the lockfile to use the latest version of bundler
$ bundle update --bundler
* Clean up javascript.
* Return HTTP 422 instead of HTTP 500 on "you have already voted for
this post" errors.
* In json/xml error responses, return the error message in the `message`
field, not `reason`.
* In json/xml success responses, return the post itself instead of a
plain `{ success: true }` object.
* Simplify code.
* Show backtraces for all users, not just builders.
* Show backtraces only for unexpected server errors (status 5xx), not
for normal client errors (status 4xx).
* Log expected errors at info level (reduce noise in production logs).
Favoriting posts sometimes fails with ActiveRecord::LockWaitTimeout
errors. This happens when a user tries to favorite multiple posts in
short succession. In that case we want the lock to block and wait for
the other favorite to go through, not to immediately fail.