discourse/db/fixtures
Ted Johansson 25a226279a
DEV: Replace #pluck_first freedom patch with AR #pick in core (#19893)
The #pluck_first freedom patch, first introduced by @danielwaterworth has served us well, and is used widely throughout both core and plugins. It seems to have been a common enough use case that Rails 6 introduced it's own method #pick with the exact same implementation. This allows us to retire the freedom patch and switch over to the built-in ActiveRecord method.

There is no replacement for #pluck_first!, but a quick search shows we are using this in a very limited capacity, and in some cases incorrectly (by assuming a nil return rather than an exception), which can quite easily be replaced with #pick plus some extra handling.
2023-02-13 12:39:45 +08:00
..
001_refresh.rb DEV: Apply syntax_tree formatting to db/* 2023-01-09 11:59:41 +00:00
002_groups.rb DEV: Apply syntax_tree formatting to db/* 2023-01-09 11:59:41 +00:00
003_post_action_types.rb DEV: Apply syntax_tree formatting to db/* 2023-01-09 11:59:41 +00:00
004_screened_ip_addresses.rb DEV: enable frozen string literal on all files 2019-05-13 09:31:32 +08:00
005_badge_types.rb DEV: enable frozen string literal on all files 2019-05-13 09:31:32 +08:00
006_badges.rb DEV: Apply syntax_tree formatting to db/* 2023-01-09 11:59:41 +00:00
007_web_hook_event_types.rb FEATURE: adds the user_promoted event to webhooks (#15996) 2022-02-22 10:57:18 +01:00
009_users.rb DEV: Apply syntax_tree formatting to db/* 2023-01-09 11:59:41 +00:00
010_uploads.rb DEV: update comments on unused Uploads. -4 is now considered reserved. (#14362) 2021-09-16 17:44:51 -04:00
500_categories.rb DEV: Apply syntax_tree formatting to db/* 2023-01-09 11:59:41 +00:00
600_themes.rb DEV: Replace #pluck_first freedom patch with AR #pick in core (#19893) 2023-02-13 12:39:45 +08:00
990_settings.rb DEV: Only warn about invalid email setting in production 2020-04-15 11:21:21 -04:00
990_topics.rb DEV: Apply syntax_tree formatting to db/* 2023-01-09 11:59:41 +00:00