Better HN
topnewbestaskshowjobs
Log inSign up

evgeniydemin

8 karma · joined Feb 1, 2023 (3y ago) · 24 submissions

Submissions

comment 3y ago · link · parent

I’m working on a Rails upgrade for a giant monolith application. It’s been a while already, and while I’m encountering many issues trying to jump from 5.2+ right to 6.1, I want to share some of the stories.

comment 3y ago · link · parent

Are you a user of FactoryBot?

If so, I highly recommend taking a look at the FactoryTrace gem!

This gem is designed to automatically detect and identify unused factories and traits in your codebase. It's a fantastic tool for keeping your code clean and removing any unnecessary clutter.

3.

Clean FactoryBot with FactoryTrace(github.com ↗)

3 points · by evgeniydemin · 3y ago · 1 comment

comment 3y ago · link · parent

I recently stumbled upon a perplexing discrepancy while converting Time to DateTime using the #to_datetime method. Intrigued by this unexpected behavior, I delved into an investigation to unravel its root cause. I’ll share my findings in this blog post with you, as I believe it’s worth your attention.

comment 3y ago · link · parent

Writing CRUD controllers in Rails may seem easy, but as your application grows, you'll find it increasingly difficult to maintain and update your code. In this article, you'll learn why extracting business logic from your controllers and creating focused, testable business actions is a necessary change.

comment 3y ago · link · parent

These simple facts can help boost your application's performance or avoid memory bloats.

comment 3y ago · link · parent

Thank you very much for your comments! I appreciate that!

So far, I see that N+1 is a "measurable" problem that doesn't have to be removed with an additional layer of hidden complexity.

comment 3y ago · link · parent

I'm sorry; I didn't know memes are considered bad things. I'm experimenting with "facing" pictures and haven't found my style so far.

What kind of image would you suggest I have on posts like this?

comment 3y ago · link · parent

Why would you spend your time dealing with annoying N+1 problems when you can enable auto-preloading and forget about it for good? Are you surprised it's possible? Check it out!

10.

No More N+1. Period(evgeniydemin.medium.com ↗)

19 points · by evgeniydemin · 3y ago · 14 comments

comment 3y ago · link · parent

It’s a popular internet recommendation to use eager loading in Ruby on Rails applications to eliminate the N+1 query problem. It may seem like a blessing initially, but it has drawbacks. Gladly, there is a much better solution I want to share with you.

12.

Stop using eager loading in your Rails application; use this instead(evgeniydemin.medium.com ↗)

2 points · by evgeniydemin · 3y ago · 1 comment

comment 3y ago · link · parent

Glad that you liked it! True about timecop.

comment 3y ago · link · parent

Are you interested in how Ruby stores numbers in memory? It can look not very sensible initially, but knowing this can help you grow professionally.

15.

Ruby Numbers and the Memory: how I got confused(evgeniydemin.medium.com ↗)

4 points · by evgeniydemin · 3y ago · 3 comments

comment 3y ago · link · parent

Unfortunately, I learned it the hard way. Check out the article to avoid the same mistakes.