This repository has been archived on 2023-03-18. You can view files and clone it, but cannot push or open issues or pull requests.
osr-discourse-src/app
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
..
assets FIX: d-button should default type to button (#8217) 2019-10-21 09:42:19 +02:00
controllers DEV: pluck_first 2019-10-21 12:08:20 +01:00
helpers DEV: pluck_first 2019-10-21 12:08:20 +01:00
jobs DEV: pluck_first 2019-10-21 12:08:20 +01:00
mailers DEV: pluck_first 2019-10-21 12:08:20 +01:00
models DEV: pluck_first 2019-10-21 12:08:20 +01:00
serializers FEATURE: Display created and last_used dates for API keys 2019-10-09 14:24:41 +01:00
services DEV: pluck_first 2019-10-21 12:08:20 +01:00
views Add digest email template classes for popular post section 2019-10-16 11:22:33 -04:00