🚢 In related news, the official MRSK homepage at MRSK.dev has lost its original brutalist design and now looks slick and ready to sail. There's a 20-minute screencast introduction from DHH to enjoy as well. |
Some Advanced Active Record Concepts— Quick examples of concepts including locking records to avoid conflicts, using UUIDs as primary keys, fulltext search, using database views, and working with geospatial data. Paweł Dąbrowski |
![]() Smooth and Powerful Sidekiq Monitoring— Track and debug Sidekiq performance metrics with ease. Get insights and alerts for Sidekiq queue lengths, Sidekiq throughput/performance per worker, and Sidekiq process/connection counts. AppSignal sponsor |
Stop Ignoring Your Ruby and Rails Deprecations (and How)— No-one wants to see warnings and it’s tempting to skip over them, but they’re there for a reason. Ali explains how deprecation warnings can help you upgrade your app before you really upgrade your app (which can help a lot when upgrading Rails versions in particular), and shows off of a technique for formally making deprecations part of an app’s reality. Ali Ibrahim |
📕 Tutorials, Articles, and Videos |
Updating Millions of Records in Rails— Ideally you’d step down to the database layer and avoid the overhead of Active Record entirely when doing large numbers of updates, but if that’s not viable, this is a reasonable Ruby-based approach based around Sidekiq and updating records in batches. Tomas Valent |
Making Lazy Accessors Thread-Safe— Greg created a gem called Feature Envy that pulls in features from other languages. In this case, he creates thread-safe, lazy attributes in Ruby, which is more involved than you might expect. Greg Navis |
The Hardest Question on a Ruby Array Quiz— Only 2.07% of participants in a recent quiz got this one right – mostly because of not knowing the default no-argument behavior of split , I suspect. This is all really just trivia, but I did learn that Array#sum does not only act upon numeric objects.. Domhnall Murphy |
ViewComponent 3.0: React-like View Components for Rails— A framework for building reusable, testable & encapsulated view components in Rails, inspired by React. v3.0, a pretty significant release featuring work from over 200 contributors, was unveiled at RailsConf earlier this week. ViewComponent Contributors |
Low Cost, Rails Code Audit by a Senior Dev— We rapidly review your app using a nine point audit including security, tech debt, performance, versions and code quality with full recommendations on each. reinteractive Pty Ltd sponsor |
💬 Tip of the Week Using a 'fake' domain with SSL locally via Khash Sajadi of Cloud66 |
If you want to test a feature that not only requires SSL/TLS but also a custom domain of your choice, and all on a locally running app, there are a variety of ways to achieve this. An approach I really like is using mkcert and Caddy. On macOS, it's as simple as this: brew install mkcert
brew install nss # if you use Firefox
brew install caddy
(Note: If you're using Linux, use these instructions instead.) Then you can install mkcert and generate the certificate of your choice like so: mkcert --install
mkcert app.acme.com
mkcert creates certificates against a local-only certificate authority that your browser will recognize, allowing you to create and sign against any domains of your choice. A Caddyfile will then act as the HTTP server terminating the TLS connection and serving up the certificate:
app.acme.com
reverse_proxy localhost:3000
tls app.acme.com.pem app.acme.com-key.pem
Then you need to add a line like 127.0.0.1 app.acme.com to your /etc/hosts file, run your app in the usual way, and then run caddy run for everything to spring into action. (Note: If your app server runs on a different port to 3000, you can update that in the Caddyfile above.) Note: This is just a quick recap for Ruby Weekly but you can find the complete blog post at Running Rails Development with a Fake Domain and SSL on the Cloud 66 blog. |
|
Find Ruby Jobs with Hired— Hired makes job hunting easy-instead of chasing recruiters, companies approach you with salary details up front. Create a free profile now.
Hired |
|
|