mirror of
https://github.com/discourse/discourse.git
synced 2024-11-25 09:42:07 +08:00
25a226279a
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. |
||
---|---|---|
.. | ||
active_record_attribute_methods.rb | ||
ams_include_without_root.rb | ||
better_handlebars_errors.rb | ||
copy_file.rb | ||
cose_rsapkcs1.rb | ||
fast_pluck.rb | ||
inflector_backport.rb | ||
ip_addr.rb | ||
mail_disable_starttls.rb | ||
pluck_first.rb | ||
rails_multisite.rb | ||
rails4.rb | ||
safe_buffer.rb | ||
safe_migrations.rb | ||
schema_migration_details.rb | ||
sprockets_patches.rb | ||
translate_accelerator.rb |