RubyFlow The Ruby and Rails community linklog

×

The Ruby and Rails community linklog

Made a library? Written a blog post? Found a useful tutorial? Share it with the Ruby community here or just enjoy what everyone else has found!

Submit a post

You can use basic HTML markup (e.g. <a>) or Markdown.
Note that your post may be edited to suit the format of the site.

As you are not logged in, you will be
directed via GitHub to signup or sign in

Post Preview

Note: Only the first pargraph is shown on the front page and overly long paragraphs may be broken up.

Query collections of ActiveModel objects like an ActiveRecord::Relation

Working with collections of ActiveModel objects next to ActiveRecord objects is always kinda awkward because the interfaces for filtering, sorting, and querying are so different 😫 This is why we just released ActiveModel::Relation which attempts to provide the same interface to work with collections of ActiveModel objects that you’re used to from ActiveRecord::Relation 🎉 Check out the repository to learn more!

RSpec Stubs The Object In Memory

Have you ever tested a method that pulls records out of the database and applied mocks to those records you just created in your test? Have you been surprised that the record does not appear to have the behavior you mocked out? I have an explanation of the situation for you and some options for how you can address it. [more inside]

A change that makes experience with actual_db_schema even smoother

🚨 New in #actual_db_schema v0.7.9: No more frustrating halts on failed phantom migrations! Instead of “failing fast,” errors are now collected and reported in the console, keeping your workflow smooth and helping you complete schema dumps without interruptions. [more inside]

How to load a lazy loaded turbo frame a bit before it scrolls into view

A quick tip on improving lazy loaded turbo frames. Sometimes you want to start loading it a bit before it scrolls into view to provide a smoother UX: How to load a lazy loaded turbo frame a bit before it scrolls into view

pg-locks-monitor - a simple gem to observe PostgreSQL database locks in Rails apps

This gem allows to observe database locks generated by a Rails application. By default, locks data is not persisted anywhere in the PostgreSQL logs, so the only way to monitor it is via analyzing the transient state of the pg_locks metadata table. pg-locks-monitor is a simple tool that makes this process quick to implement and adjust to each app’s individual requirements. [more inside]

Loading older posts