Michael keene
2025-06-24

@Kowfm nice read man. I like the bit about Athletics, it reminds me of something @codefolio said about training like an artist doing studies youtu.be/33fAzjOTaDE?si=sqQdQ4
He has spoken a few times comparing programming and art and I found it really encouraging. Your journey looks tough, but you inspire me to do better. I'm rooting for you.

2025-06-12

@remi nice read! I don't often see opportunities for SimpleDelegator, so it's nice to be reminded.

A couple of things stood out to me:
- you don't need to define or use `teacher`
In the delegated class, calling `max_number_of_students` will be delegated to the wrapped object anyway. I personally prefer this to messing with dunder methods.

- I'd use/mention Forwardable.
In a similar way to your home-brewed decorator, wrap the object and def_delegator _ONLY_ the methods you need. Lower interface

2025-06-11
2025-06-11

@wj I think perhaps if your mouse runs out of charge, charging it and making a coffee feels like a natural reaction, rather than a thing to remember.

2025-04-03

@hschne there is also `class_option` which has the same signature as method_option but applies to the whole class. Regardless another handy tip is that sharable methods can also live in a module which is nice for sharing between different classes.

2025-02-23

@aristotelesbr lastly, thinking about the `why?` in this case I see you're writing a test. I have found the failure text of assert_pattern to be somewhat lacking, instead I'd rather use assert_equal 3 times than assert pattern. Maybe it's improved since I used it, but I fear that once you see pattern matching it becomes a golden hammer, I know it did for me.

2025-02-23

@aristotelesbr the other thing to say is during pattern matching you can match on things that don't define [], as the syntax is just used to collect a specification for matching and isn't actually called on the object/class. If you are desperate to compare with a Klass.new then maybe pattern matching isn't the approach you need, because that's not how it works.

2025-02-23

@aristotelesbr my example is weird as hash literals are either symbol keys {year: year_of_birth} or hash rockets {Integer => year_of_birth} you never ever get both describing a single key valve pair, except pattern matching. You also can't match constructed ruby things. E.g. typed_array => [Integer, Integer, Integer] works but typed_array => Array.new(typed_array.size, Integer) doesn't. During pattern matching you can only do class and values. Klass[I, j, k] or Klass[is: 1, this: 2, helping: 3]

2025-02-22

@tom @aristotelesbr yeah ruby acts very differently during pattern matching. My favourite example stuff like
```
thing in Thing[year: Integer => year_of_birth]
```
Feels like a three layered fraction but it's totally valid. Try it out!

2025-01-22

@junkman @nateberkopec @getajobmike he has definitely been heavily involved in Rails. He made the decision to remove TS from rails related js. He threw a fit when he was denied the keynote at RailsConf, then made his own Conference RailsWorld. He does the video demoing a simple app upon a new version release. He vetos PRs and community raised issues. He is still very much Mr Rails. The community is awesome, and he is ruining us, so we should remove him and his relevance however we can.

2025-01-22

@nateberkopec @getajobmike DHH's legitimacy and influence come from his status as the head of Rails more than his businesses. There are more and more catalogue site where companies can proudly list themselves as using Rails, every day there are more gems that are built for Rails apps. These all increase the legitimacy and influence of Rails and by proxy DHH. I work with Rails, and love the community Rails has, but with him at the helm I will no longer share that with pride. I welcome a fork.

2025-01-18

@ecomba @janpet as long as it's just the one method it should be risk free, however I've caused myself so many problems trying to be clever that I prefer being explicit over hiding the code or being fancy.

2025-01-18

@ecomba @janpet you'd still need to include the module somewhere or define it on the ApplicationController. I'd make the current concern a nested concern, and make an outer concern that provides the pretty dsl for adding the config.
Something like:
```
module InlineEditing
extend ActiveSupport::Concern

class_methods do
def inline_editable(**)
include InlineEditing::InlineEditable.config(**)
end
end

module InlineEditable
[Current module]
end
end
```
Then do both

2025-01-04

@janpet I think it's one of those classic "it depends". We have tasks that get set up for 3~18months, having background jobs scheduled that whole time feels like it could get to be a large table, but it'll be no bigger than the task table. Maybe a non-issue. We have a cronjob every hour that (via rake) checks for overdue tasks, and sets up a "generate reminder job" that runs asap to make the email in a background job. Lmk what you go with as I'd love alternatives.

2024-12-05

@michaelloistl @joeldrapper
beta.phlex.fun/guides/v2-upgra
There's a reasonable explanation and a way to get the same behaviour

2024-11-26

@remi maybe I'm missing some context, could you not just `includes` the follow model to avoid the N+1 or outer joins the follow model to the author model where the user is `Current.user`? Updating the button when the user clicks on it via turbo seems sensible, but surely there is another way to index the correct button?

2024-11-04

@purinkle I found the @sandimetz POODR eye opening. Duck typing and actually considering where responsibilities lie feels like basics now but when I was converting from scrappy self taught python dev to professional ruby developer it was BIG. Speaking of python, something that I return to often is the "zen of python". It's short (19 lines) but it's meaning seems to grow as I improve. Zero to production in rust made me see TDD in a new light, I now feel like it's probably a good idea :)

2024-08-19

@jnunemaker greater than/less than too, which is much nicer compared to the string version

2024-07-30

It's very scary for me but I have plucked up the courage to share my first article. dev.to/michaelkeene/the-strang
It comes with a gist to run the examples, plus *bonus content*

TL:DR I noticed an interesting piece of syntax in #ruby when you want to both confirm a values class, and cast it to a local variable.

In future I am aiming to reduce the number of idioms and regional colloquialisms to make it more approachable to a wider audience. Other constructive comments are welcome.

2024-01-30

@janpet you need to create a service layer that contains your business logic.
youtu.be/CRboMkFdZfg?si=hmL55_

There are many many options, but typically there ends up being a Command Pattern object that is responsible for the business logic process. Be that creation of a bunch of objects, using external services or whatever CRUD combo you need to throw in there.

They get called a whole host of things. Operations/Actions/Transactions/Commands and probably more. You can roll your own PORO or use a gem.

Client Info

Server: https://mastodon.social
Version: 2025.04
Repository: https://github.com/cyevgeniy/lmst