Files
danbooru/script/fixes/061_fix_favgroup_privacy.rb
evazion 4a7322b197 users: rework privacy mode into private favorites (fix #4257).
* Rename 'privacy mode' to 'private favorites'.
* Make the private favorites setting only hide favorites, not favgroups
  and not the user's uploads on their profile page.
* Make the favgroup is_public flag default to true instead of false and
  fix existing favgroups to be public if the user didn't have privacy mode
  enabled before.
* List _all_ public favgroups on the /favorite_groups index, not just
  favgroups belonging to the current user.
* Add a /users/<id>/favorite_groups endpoint.
2020-01-17 22:24:29 -06:00

9 lines
258 B
Ruby
Executable File

#!/usr/bin/env ruby
require_relative "../../config/environment"
users = User.bit_prefs_match(:enable_private_favorites, true)
favgroups = FavoriteGroup.where(is_public: false).where.not(creator_id: users.select(:id))
favgroups.update_all(is_public: true)