An email newsletter, with one Ruby/Rails technique delivered with a ‘why?’ and a ‘how?’ every two weeks. It’s deliberately brief, focussed & opinionated.
- A job should know whether to run itself
- Us Hash#fetch when using Rails params in controllers
- Stop robots and crawlers causing error in your Rails application
- Check you database indexes for ActiveRecord scopes
- Only use named scopes outside models
- Avoid Writing SQL When Using ActiveRelation
- Enumerable avoids using temporary variables when looping
- Be sparing when using unless
- Truthiness in Conditionals
- Set your page title in the view template using content_for
- Choose UUIDs for model IDs in Rails
- Use a pull request template
- Use simplecov in your Rails test suite
- Rescue specific errors. Avoid rescuing StandardError. Don’t rescue Exception.
- Don’t use default_scope. Ever.
- Use Rails’ naming conventions for dates & times