💡 TIL: pick is the single-value version of pluck in Rails
26th November 2024
Instead of doing
Messages.pluck(:user_id).firstyou can do
Messages.pick(:user_id)
More recent articles
- Ruby's clamp method reduces conditionals - 24th February 2025
- Regex within string square brackets - 24th February 2025
- Elegant solution to versioning an API - 24th February 2025