Files
danbooru/db/seeds.rb
evazion 88dfc463a1 db/seeds: fix deprecation warning in find_or_create_by!.
`User.find_or_create_by!` calls `User.name_matches` during username
validation, which triggers a deprecation warning for some reason:

    DEPRECATION WARNING: Class level methods will no longer inherit scoping
    from `create!` in Rails 6.1. To continue using the scoped relation,
    pass it into the block directly. To instead access the full set of
    models, as Rails 6.1 will, use `User.default_scoped`.
2020-06-10 22:33:36 -05:00

8 lines
146 B
Ruby

require "securerandom"
User.create(
name: Danbooru.config.system_user,
password: SecureRandom.base64(32),
level: User::Levels::MODERATOR
)