Ruby + Rails : Distilled's Avatar

Ruby + Rails : Distilled

@distilled.skillstopractice.com

A collection of posts of interest to Ruby and Rails developers. Hand-picked, high signal, always on topic. Maintained by @skillstopractice.com Also available as a feed: https://bsky.app/profile/did:plc:ip3trmvdbnlm4g7cdc5xs7ub/feed/aaaf5jle4pb7e

65
Followers
156
Following
18
Posts
12.04.2025
Joined
Posts Following

Latest posts by Ruby + Rails : Distilled @distilled.skillstopractice.com

Original post on mastodon.social

I just signed the open letter to the Rails Core team, after hesitating for a long time about whether that was the right choice for me.

I know and like several Rails core members, as well as several Basecamp employees. I understand the squeeze that can happen when speaking out individually only […]

28.09.2025 16:47 πŸ‘ 5 πŸ” 4 πŸ’¬ 1 πŸ“Œ 0
Post image

So the way I read this is a sponsor forced this action by Ruby Central.

If that sponsor was Shopify, then in effect, this confirms that a company that DHH is a board member of forced this action.

If not, who was responsible for this then?

This is a very […]

[Original post on mastodon.social]

21.09.2025 23:17 πŸ‘ 7 πŸ” 2 πŸ’¬ 1 πŸ“Œ 1

Sorry for the very long thread!

Just wanted to get this all out there so I can link to it if anyone else asks.

21.05.2025 18:10 πŸ‘ 7 πŸ” 0 πŸ’¬ 0 πŸ“Œ 0

Now if there's a learning and growing that happens... I'll be back! This is the closest I've seen to a platform that *could* work at global scale.

Mastodon is solving a different problem.

But it's a safer place for me to be until atproto has at least a couple alternative platforms on it.

21.05.2025 18:10 πŸ‘ 4 πŸ” 0 πŸ’¬ 1 πŸ“Œ 0

I spent the last decade as a management consultant / exec advisor for several different businesses (one of which was much bigger than Bluesky in revenue + team size) trying to design sustainable revenue models that take network effects into account.

I don't see it here, so I gotta go.

21.05.2025 18:09 πŸ‘ 3 πŸ” 0 πŸ’¬ 1 πŸ“Œ 0

I believe in the good intentions of the team and even in the lack of *active* ill-intent from the person I'm referring to here, and I did have a meaningful convo in private where I felt heard and was told that my notes have been passed on to the team.

But I also make my own choices on principle.

21.05.2025 18:08 πŸ‘ 2 πŸ” 0 πŸ’¬ 1 πŸ“Œ 0

It turned my stomach to see that team member playfully say things like "Should I delete that post for you since its an ad?" when it was a link to some small individual creator's work.

To think that's what we've got shaping strategy at one of the world's most influential platforms is very unsettling

21.05.2025 18:06 πŸ‘ 2 πŸ” 1 πŸ’¬ 1 πŸ“Œ 0

All of this triggered alarm bells of tech startup culture where engineers + product designers lead efforts and there's a lack of seriousness about building real, sustainable business models, and a lack of responsibility to use power and visibility appropriately and be mindful of differentials.

21.05.2025 18:04 πŸ‘ 2 πŸ” 0 πŸ’¬ 1 πŸ“Œ 0

I observed one of Bluesky's most visible team members poking fun at and being unkind to someone who runs a small account here for questioning their intentions, and that same person treated me very poorly as well until they realized I had a nuanced argument to make.

21.05.2025 18:02 πŸ‘ 3 πŸ” 0 πŸ’¬ 1 πŸ“Œ 0
Bluesky Business Model - Risk Factors | S2P :: Notes Notes from Gregory Brown

notes.skillstopractice.com/updates/2025...

I had assumed that Bluesky had made a commitment to seek a self-sustaining business model that didn't involve ad revenue and I was wrong about that, even though prior conversations with the team made me believe otherwise.

21.05.2025 18:00 πŸ‘ 2 πŸ” 0 πŸ’¬ 1 πŸ“Œ 0

Ruby + Rails : Distilled is moving to Mastodon.

Just getting set up over there but you'll find the account here:

ruby.social/@distilled

I will set up bridging when I can, not sure if I will do crossposting though.

If you're set up with @ap.brid.gy here I can still share your posts that way.

21.05.2025 11:55 πŸ‘ 7 πŸ” 1 πŸ’¬ 1 πŸ“Œ 0

I'm leaving Bluesky effective immediately and this is the reason why.

I'll post when I get Mastodon set up + an RSS feed + newsletter.

19.05.2025 21:41 πŸ‘ 2 πŸ” 1 πŸ’¬ 0 πŸ“Œ 4
Preview
SOLID: Interface Segregation Principle (ISP) The Interface Segregation Principle is about designing thin, cruft-free interfaces which results in reduced coupling.

The penultimate part of SOLID: the Interface Segregation Principle.

17.05.2025 10:14 πŸ‘ 6 πŸ” 3 πŸ’¬ 0 πŸ“Œ 0
ViewComponents, the Missing View Layer for Rails If you’ve worked with Rails for any measure of time, then you know that Rails’ Views can quickly get out of hand. Between Helpers, instance variables, and inline logic, they quickly become bloated and...

ViewComponents reduce bloat, simplify data, and create reusable frontend styling. Despite these benefits, they're often under-utilized in the Rails community. I've written a blog post refactoring a real-world example into isolated ViewComponents.

joshfrankel.me/blog/viewcom...

#ruby #rubyonrails

15.05.2025 12:56 πŸ‘ 4 πŸ” 2 πŸ’¬ 1 πŸ“Œ 0
πŸŽ“ How .excluding works in Rails Rails provides a convenient .excluding method for identifying a group of items while omitting another set.

You might get less performance from using `.excluding` than `.where.not` and here's why.

dcyoung.dev/shorts/how-e...

#RubyOnRails #WebDevelopment

16.05.2025 11:05 πŸ‘ 8 πŸ” 1 πŸ’¬ 0 πŸ“Œ 0

How do you manage error classes in your app?

- Granular β€” Domain::Specific::NotFoundError
- Generic/Reusable β€” Error::NotFound
- Not β€” StandardError/raise 'x'

Personally, I create my own error classes so I can see what's wrong at a glance, even if it means catching existing ones.

#RubyLang

16.05.2025 09:35 πŸ‘ 7 πŸ” 3 πŸ’¬ 5 πŸ“Œ 0

Already several good RSS feeds in the thread.

Keep them coming! Discoverability is hard these days and RSS was one of those lovely tools that deserves a comeback.

16.05.2025 13:10 πŸ‘ 1 πŸ” 1 πŸ’¬ 0 πŸ“Œ 0

If you've got a blog where you (at least sometimes) write Ruby-related posts, please reply with a link to your RSS feed below.

I am going to try to start keeping an eye on those as well and sharing interesting stuff I find from time to time.

15.05.2025 23:48 πŸ‘ 11 πŸ” 8 πŸ’¬ 14 πŸ“Œ 3

What do you love about programming in #ruby?

15.05.2025 15:04 πŸ‘ 3 πŸ” 2 πŸ’¬ 9 πŸ“Œ 0
Screenshot of Ruby code:

class Pizza
  def self.margherita
    new(sauce: 'tomato', cheese: 'mozzarella', toppings: %w[basil])
  end

  def self.vegetariana
    new(sauce: 'tomato', cheese: 'mozzarella',
        toppings: %w[aubergine mushrooms peppers onions olives])
  end

  private_class_method :new

  def initialize(sauce:, cheese:, toppings:)
    @sauce = sauce
    @cheese = cheese
    @toppings = toppings
  end
end

Screenshot of Ruby code: class Pizza def self.margherita new(sauce: 'tomato', cheese: 'mozzarella', toppings: %w[basil]) end def self.vegetariana new(sauce: 'tomato', cheese: 'mozzarella', toppings: %w[aubergine mushrooms peppers onions olives]) end private_class_method :new def initialize(sauce:, cheese:, toppings:) @sauce = sauce @cheese = cheese @toppings = toppings end end

Screenshot of Ruby code:

Pizza.margherita
# => #<Pizza:0x0000000121c17f10
#      @cheese="mozzarella",
#      @sauce="tomato",
#      @toppings=["basil"]>

Pizza.vegetariana
# => <Pizza:0x0000000120f34988
#      @cheese="mozzarella",
#      @sauce="tomato",
#      @toppings=["aubergine", "mushrooms", "peppers", "onions", "olives"]>

Pizza.new(sauce: 'white', cheese: 'none', toppings: %w[pineapple])
# => private method 'new' called for class Pizza (NoMethodError)

Screenshot of Ruby code: Pizza.margherita # => #<Pizza:0x0000000121c17f10 # @cheese="mozzarella", # @sauce="tomato", # @toppings=["basil"]> Pizza.vegetariana # => <Pizza:0x0000000120f34988 # @cheese="mozzarella", # @sauce="tomato", # @toppings=["aubergine", "mushrooms", "peppers", "onions", "olives"]> Pizza.new(sauce: 'white', cheese: 'none', toppings: %w[pineapple]) # => private method 'new' called for class Pizza (NoMethodError)

Don't want to expose a class' initializer in Ruby? Making it private is easy!

Just use `private_class_method :new`.

This conveys intent that your class is not designed to be initialized from outside β€” perfect when you want to use the factory pattern.

15.05.2025 19:09 πŸ‘ 30 πŸ” 5 πŸ’¬ 0 πŸ“Œ 1

How to automatically trigger a file download with Turbo?

The user triggers the creation of a file. That file is created using a background job. I could update the view using Turbo Streams (e.g. render a 'Download Now' button). But I'd like download to automatically start πŸ€”

#rubyonrails

15.05.2025 13:29 πŸ‘ 3 πŸ” 1 πŸ’¬ 2 πŸ“Œ 0
Preview
namespaces.md GitHub Gist: instantly share code, notes, and snippets.

Namespaces 101

During the last days I have done an immersion into namespaces, the new big feature that is coming in Ruby.

Here's a digested mental model for you all.

gist.github.com/fxn/86ad8584...

15.05.2025 12:03 πŸ‘ 30 πŸ” 8 πŸ’¬ 5 πŸ“Œ 0

Incredibly common Rails perf anti-pattern:

Rails.cache.fetch([complicated,cache,key], expires_in: random_interval) do
dog_of_a_SQL_query
end

Cache hitrate: 10% (if anyone even knows what it is)

14.05.2025 17:04 πŸ‘ 19 πŸ” 1 πŸ’¬ 2 πŸ“Œ 0
Post image

Quick reminder that you should be using Jemalloc πŸ‘€

#rubyonrails #ruby

14.05.2025 13:28 πŸ‘ 6 πŸ” 2 πŸ’¬ 2 πŸ“Œ 0
Preview
Retire CGI library without `cgi/escape` by hsbt Β· Pull Request #13275 Β· ruby/ruby https://bugs.ruby-lang.org/issues/21258

Right, it was merged: github.com/ruby/ruby/pu...

14.05.2025 08:16 πŸ‘ 4 πŸ” 1 πŸ’¬ 0 πŸ“Œ 0
Preview
GitHub - ruby/cgi: CGI is a large class, providing several categories of methods, many of which are mixed in from other modules. CGI is a large class, providing several categories of methods, many of which are mixed in from other modules. - GitHub - ruby/cgi: CGI is a large class, providing several categories of methods, ma...

I guess you will need to include cgi gem: github.com/ruby/cgi

14.05.2025 08:16 πŸ‘ 4 πŸ” 1 πŸ’¬ 0 πŸ“Œ 0

hey #RubyLang folks - our tests against Ruby head in sentry-ruby started failing yesterday with:

LoadError: cannot load such file -- cgi/cookie

I'm disabling ruby head version in our CI matrix for the time being but maybe there's a fix somewhere?

14.05.2025 07:19 πŸ‘ 5 πŸ” 1 πŸ’¬ 2 πŸ“Œ 0

Your periodic reminder that consolidating a wobbly design is worse than a waste of time, it interferes with further improvement. Sometimes the best thing is put all the elements in one pile until the fault lines become clear. #AugmentedCoding #GeniesDesignBadly

14.05.2025 02:52 πŸ‘ 29 πŸ” 7 πŸ’¬ 1 πŸ“Œ 0

What's the best host for running a Ruby application, that stores files on the server, and runs sqlite as the database, on the server?

13.05.2025 16:54 πŸ‘ 3 πŸ” 1 πŸ’¬ 2 πŸ“Œ 0

Having setters that appear to be at the instance level apply at the class level is something that (for me) definitely would be against the Principle of Least Surprise.

An easy way to define class level accessors is nice but hard to see the use case for the instance level behavior.

13.05.2025 14:02 πŸ‘ 5 πŸ” 1 πŸ’¬ 0 πŸ“Œ 0