-
Rails / ActiveRecord count, size, and length
When trying to be sensitive to n+1 queries and memory usage, knowing the differences between count, size, and length in ActiveRecord is important. It had been a while since I reviewed the usage, and I wanted to ensure that I hadn’t made some bad assumptions along the way that somehow stuck. The reality is that…
-
Enphase Envoy Solar Array monitoring with a Raspberry Pi to Save $100 or More from Downtime
Using a rasbperrypi to monitor and alert on your solar output
-
Referencing one trait from another trait in factory_bot
Sometimes you want to DRY up traits by referencing one trait from another trait in factory_bot. I tried searching on “inheriting traits” (that’s just for one factory inheriting traits from another and was in a factory_bot issue in GitHub). I accidentally stumbled upon the answer in a slightly unrelated StackOverflow question about calling a trait…