ruby.social is one of the many independent Mastodon servers you can use to participate in the fediverse.
If you are interested in the Ruby programming language, come join us! Tell us about yourself when signing up. If you just want to join Mastodon, another server will be a better place for you.

Administered by:

Server stats:

1.1K
active users

Garrett Dimon :ruby:

Tired of accidental God objects or junk drawers for model logic?

@kaspth created a wonderful gem for "Associated Objects" to help organize model code, and it plays nicely with Rails to boot.

I wrote a bit about our experience using it with @flipper in conjunction with some impending pricing updates. garrettdimon.com/journal/posts

GarrettDimon.com · Organizing Rails Code with ActiveRecord Associated ObjectsThe ActiveRecord::AssociatedObject gem is a great tool to help organize logic that fits nicely into an encapsulated concept but only ever needs to interact...

@garrettdimon @kaspth @flipper This is a really nice introduction to the associated objects gem. To my mind the biggest question is whether I'd want that object to be quite that tightly coupled (or coupled in those ways) to its model, but I feel like the post gave me a good idea of what I'd get with associated objects.