discourse/app/models/concerns
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
..
anon_cache_invalidator.rb DEV: enable frozen string literal on all files 2019-05-13 09:31:32 +08:00
cached_counting.rb DEV: pluck_first 2019-10-21 12:08:20 +01:00
category_hashtag.rb FIX: Account for nil when looking up subcategories 2019-10-16 20:04:54 +01:00
has_custom_fields.rb FIX: Use correct timezone for manual SQL 2019-07-06 15:14:07 -04:00
has_destroyed_web_hook.rb DEV: enable frozen string literal on all files 2019-05-13 09:31:32 +08:00
has_search_data.rb DEV: enable frozen string literal on all files 2019-05-13 09:31:32 +08:00
has_url.rb DEV: enable frozen string literal on all files 2019-05-13 09:31:32 +08:00
limited_edit.rb FEATURE: New post editing period for >= tl2 users (#8070) 2019-09-06 07:44:12 -04:00
positionable.rb DEV: enable frozen string literal on all files 2019-05-13 09:31:32 +08:00
roleable.rb DEV: enable frozen string literal on all files 2019-05-13 09:31:32 +08:00
searchable.rb DEV: enable frozen string literal on all files 2019-05-13 09:31:32 +08:00
second_factor_manager.rb FEATURE: Webauthn authenticator management with 2FA login (Security Keys) (#8099) 2019-10-01 19:08:41 -07:00
stats_cacheable.rb DEV: enable frozen string literal on all files 2019-05-13 09:31:32 +08:00
trashable.rb DEV: enable frozen string literal on all files 2019-05-13 09:31:32 +08:00