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 |
||
|---|---|---|
| .. | ||
| admin_confirmation_mailer.rb | ||
| download_backup_mailer.rb | ||
| invite_mailer.rb | ||
| rejection_mailer.rb | ||
| subscription_mailer.rb | ||
| test_mailer.rb | ||
| user_notifications.rb | ||
| version_mailer.rb | ||