Dan Brown


630 Experience
6 Lessons Completed
0 Questions Solved


I’m pretty sure this causes an infinite loop if you need to convert a model column into a rich_text field and do something like model.update/update_attribute(content: model.old_content). I’ve never seen such a bad loop — I actually had to kill my PostgreSQL process.

Posted in Tracking online users with timestamps Discussion

At scale, wouldn't adding an update call to every action for every user just be hammering the database?

Posted in User Referral Program From Scratch Discussion

I think you would actually want to call before_validation :set_referral_code, on: :create to summarize the comments from above.