danott.website / archive / 2018

When testing ActiveJob, jobs performed with SomeJob.perform_now will not show up in the performed_jobs test helper method.

Stimulus (stimulusjs.org)

Basecamp triples down on server rendered HTML with StimulusJS. Having built a similar pattern when transitioning away from batman.JS years ago, I really appreciate the refinement of the ideas here.

My only complaint about this project is that they didn’t name it Sprinkles. That would have been awesome.

At some point in time Rails added a nicety to ActionMailer that I’ve really appreciated. The nicety I mention is that an html formatted email will be automatically translated into a plaintext email counterpart that is not perfect, but passable when iterating on a blossoming application.

As our applications mature we’re upping our efforts on accessibilty. Within that effort, the automatically generated plaintext emails are being replaced by artisinal plaintext emails.

We’re good about writing tests, but our tests broke when we moved from providing the single part to providing multiple parts.

Today I rel-learned how to get to the different parts of the email when they’re being provided explicitly.

-assert_includes email.body.encoded, "some expected text"
+assert_includes email.html_part.body, "some expected text"
+assert_includes email.text_part.body, "some expected text"

Thanks again Stackoverflow.

SpreadsheetArchitect (github.com)

SpreadsheetArchitect lets you turn any activerecord relation or ruby object collection into a XLSX, ODS, or CSV spreadsheet

There are several Ruby and Rails projects in my rear view that would have benefited from this tool.