David · @dcyoung_dev
24 followers · 69 posts · Server ruby.social

Polymorphic Relationships in ActiveRecord - dick.codes

Full-stack Ruby on Rails engineer. Blogs about programming topics.

dick.codes/2023/07/10/polymorp

#backend #Ruby_on_Rails

Last updated 1 year ago

David · @dcyoung_dev
24 followers · 68 posts · Server ruby.social

What is the difference between Turbo and Stimulus, and what exactly is Hotwire?

I’m going to try to help out by giving you a quick overview of what these things are, and where they fit in to the bigger picture. I’ll assume you’re familiar with the “basic” Rails stack - DB -> Models -> Controllers -> Views. Then, I’ll point you to some resources which you can use to dive deeper.

ducktypelabs.com/turbo-vs-stim

#hotwire #Ruby_on_Rails

Last updated 1 year ago

David · @dcyoung_dev
24 followers · 67 posts · Server ruby.social

Testing Inherited Behavior

This post describes different ways of testing inherited behavior, including duplicating the tests, not testing the inherited behavior, and using a shared example.

kevinjmurphy.com/posts/testing

#Ruby_on_Rails #testing

Last updated 1 year ago

David · @dcyoung_dev
24 followers · 66 posts · Server ruby.social

Beware of <%== in your erb files

The danger of an extra equals

andycroll.com/ruby/beware-of-r

#frontend #Ruby_on_Rails

Last updated 1 year ago

David · @dcyoung_dev
24 followers · 65 posts · Server ruby.social

Rails 7.1 introduces deliver callbacks for ActionMailer

Rails 7.1 adds before_deliver and after_deliver callbacks to ActionMailer to hook into the lifecycle events of the mail delivery.

shakacode.com/blog/rails_add_d

#backend #Ruby_on_Rails

Last updated 1 year ago

David · @dcyoung_dev
24 followers · 64 posts · Server ruby.social

Building Value Objects in Rails with composed_of

Learn how to improve the interface of your existing Active Record Models with this underutilized API.

thoughtbot.com/blog/rails-valu

#backend #Ruby_on_Rails

Last updated 1 year ago

David · @dcyoung_dev
24 followers · 60 posts · Server ruby.social

Fix n+1 queries by caching computed values

N+1 queries are not always a problem, but I have seen that most of the n+1 queries that are really a problem are when we need to fetch data to compute something.
Here I will try to share some examples of posible expensive computations candidates to...

bhserna.com/fix-n+1-queries-by

#backend #Ruby_on_Rails

Last updated 1 year ago

David · @dcyoung_dev
24 followers · 54 posts · Server ruby.social

Computed columns with the find_by_sql method in a Rails application

Introduction Ruby is a beautiful expressive programming language. Like many other...

dev.to/wpickeral/computed-colu

#backend #Ruby_on_Rails

Last updated 1 year ago

David · @dcyoung_dev
24 followers · 53 posts · Server ruby.social

Are you absolutely sure your Rails caching strategy isn't leaking sensitive information?

Rails writes a new cache entry based on the first request. But what happens when that request is from an admin?

thoughtbot.com/blog/rails-cach

#backend #Ruby_on_Rails

Last updated 1 year ago

0×4a6f4672 · @jofr
45 followers · 54 posts · Server ruby.social

Where can I find good documentation about the architecture & the protocol? I am curious how it works. The tech stack should feel familiar to most of us: , , , , and . As I understand the article from @aral Sidekiq is used heavily. For every post or reply you write Mastodon creates automatically background jobs which send the post to all your followers on other instances via ActivityPub protocol. Correct?
ar.al/2022/11/09/is-the-fedive

#mastodon #activitypub #ruby #Ruby_on_Rails #redux #react #redis #sidekiq

Last updated 2 years ago