discourse/lib/freedom_patches
Daniel Waterworth 55a1394342 DEV: pluck_first
Doing .pluck(:column).first is a very common pattern in Discourse and in
most cases, a limit cause isn't being added. Instead of adding a limit
clause to all these callsites, this commit adds two new methods to
ActiveRecord::Relation:

pluck_first, equivalent to limit(1).pluck(*columns).first

and pluck_first! which, like other finder methods, raises an exception
when no record is found
2019-10-21 12:08:20 +01:00
..
active_record_attribute_methods.rb DEV: enable frozen string literal on all files 2019-05-13 09:31:32 +08:00
active_record_base.rb DEV: enable frozen string literal on all files 2019-05-13 09:31:32 +08:00
ams_include_without_root.rb DEV: enable frozen string literal on all files 2019-05-13 09:31:32 +08:00
better_handlebars_errors.rb DEV: enable frozen string literal on all files 2019-05-13 09:31:32 +08:00
fast_pluck.rb DEV: enable frozen string literal on all files 2019-05-13 09:31:32 +08:00
inflector_backport.rb DEV: enable frozen string literal on all files 2019-05-13 09:31:32 +08:00
match.rb DEV: enable frozen string literal on all files 2019-05-13 09:31:32 +08:00
open_uri_redirections.rb DEV: enable frozen string literal on all files 2019-05-13 09:31:32 +08:00
performance_fixes.rb DEV: enable frozen string literal on all files 2019-05-13 09:31:32 +08:00
pluck_first.rb DEV: pluck_first 2019-10-21 12:08:20 +01:00
postgresql_adapter.rb DEV: enable frozen string literal on all files 2019-05-13 09:31:32 +08:00
rack_patches.rb DEV: enable frozen string literal on all files 2019-05-13 09:31:32 +08:00
rails4.rb DEV: enable frozen string literal on all files 2019-05-13 09:31:32 +08:00
rails6.rb DEV: bind for thread local vars should yield block 2019-09-12 17:57:57 +10:00
raw_handlebars.rb DEV: enable frozen string literal on all files 2019-05-13 09:31:32 +08:00
reaper.rb DEV: enable frozen string literal on all files 2019-05-13 09:31:32 +08:00
regexp.rb DEV: enable frozen string literal on all files 2019-05-13 09:31:32 +08:00
safe_buffer.rb DEV: enable frozen string literal on all files 2019-05-13 09:31:32 +08:00
safe_migrations.rb DEV: enable frozen string literal on all files 2019-05-13 09:31:32 +08:00
schema_migration_details.rb DEV: enable frozen string literal on all files 2019-05-13 09:31:32 +08:00
sprockets_patches.rb Correct some missing spots for frozen_string_literal 2019-05-13 09:31:32 +08:00
translate_accelerator.rb DEV: initial migration can fail 2019-09-17 13:38:01 +10:00
zeitwerk.rb PERF: avoid regex for hot path 2019-10-08 13:43:54 +11:00