I can't take Rubocop any more. Moving up to Ruby 3 forces us to update RuboCop,
and it comes with dozens of linters that I'd have to evaluate, none of which is
a marginal improvement. I'm done having opinions.
* Update fake_data to create test Categories and pass those in to
new tags when created. Does not use find_and_create_by! for new
Tags since that could attempt to create another tag with the same
name if the random Category is different.
Update fake_data to use the newer Faker::Lorem syntax, specifying
the parameter name in .sentences() and .paragraphs().
* Update fake_data script to help troubleshoot flags.
Create users that are admins, as well as moderators.
Flag comments and stories from random users.
Add user karma and invite heirarchy.
* Add more realistic data, such as stories with links and text,
saved stories, user moderation, and hat moderation.
Signed-off-by: Three Planets Software <threeplanetssoftware@users.noreply.github.com>
* Add moderation of stories (merging and deleting) to fake data.
* Add story title edits to moderation fake data.
* Update fake_data to store comments and stories in Arrays, instead of
calling the database. Set default values for the generator method.
* fix merge conflicts
* rubocop
Co-authored-by: Peter Bhat Harkins <pushcx@users.noreply.github.com>
Following error happens when running fake_data task:
> ActiveRecord::RecordInvalid: Validation failed: Story is no longer accepting comments.
The fix is do not create deleted stories with is_deleted: true
immediately, but delete them after adding comments.
Production has 2.4M records; the first run of this will drop 1.3M.
.touch uses a transaction to touch ReadRibbon timestamp; switch to a method
that doesn't do that (or callbacks or validations).
4-byte utf8 chars like emoji are passed around in ruby fine, but
when they are put into mysql queries, strings get truncated at the
first mb4 character. to prevent truncation, strip out mb4
characters in most user-controlled fields like comments, story
descriptions and titles, and messages.
to properly support utf8mb4, mysql server 5.5 is needed, the table
encodings need to be changed to utf8mb4, and the mysql2 gem needs to
be upgraded once it supports utf8mb4:
https://github.com/brianmario/mysql2/issues/249