(When using dummy data)
* to_s(16) allocates a string per character
Instead of converting the ord to hex and determining if the hex
is over 2 characters long, just see if the ord is over 255.
* .match allocates a MatchData instance and sets all sorts of backrefs
($1, $2, etc). match? just returns a boolean.
casecmp?(str) is 1.5x faster than casecmp(str).zero?
It's 1 less method call in Ruby, and the C code can convert
to boolean, rather than returning a number and determining
if it's zero.
• Added:
- CharacterCounter to ComposeDestinationHeader
- Styles for stroke colors for CharacterCounter
• Updated:
- CharacterCounter styles, heights to fit in header
If you aren't signed in, you don't have an auth token.
When you don't have an auth token, React was sending the headers
"Authorization: Bearer null"
This caused 5 Doorkeeper token lookups using
WHERE "oauth_access_tokens"."token" = 'null'
on the Explore page (the root of the app when not signed in).
Rails won't even attempt to write to a replica. Without this option,
a write attempt would actually run against Postgres, and it would
be up to Postgres to throw a readonly error.
Additionally, marking it as a replica teaches ActiveRecord that it
should not attempt to run migrations against this connection.
https://api.rubyonrails.org/classes/ActiveRecord/DatabaseConfigurations.html#method-i-configs_for
I'm actually pretty sure that the lack of `replica: true`
is why there's currently a db/slave1_schema.rb and db/slave2_schema.rb
Anything in the &default section can be merged in using <<: *default
In this case, the default already specifies that the adapter is
postgresql, the timeout is 5000, the encoding is unicode. It also
already specified the db pool, but the default actually checked 2
different ENVs and provided a fallback if it's not provided.
Lastly, I was able to move the prepared_statements section to the
defaults, because the .env.vagrant file doesn't specify
ENV['PREPARED_STATEMENTS'], development still just sets it to
'false'.
• Updated:
- all admin moderation links from app popover menus to open in new tab
- GroupOptionsPopover group admin moderation link
- ProfileOptionsPopover account admin moderation link
- StatusOptionsPopover account and status admin moderation links
• Updated:
- LinkBlock checks for if status text contains blocked domain
- normalize_link to use domain instead of normalized_host
• Added:
- normalize_link_domain to check for if entire domains are blocked or not for spam