Talks
Speakers
Events
Topics
Sign in
Home
Talks
Speakers
Events
Topics
Leaderboard
Use
Analytics
Sign in
Suggest modification to this talk
Title
Description
By, Monika M The talk is about the gotchas of ActiveRecord callbacks even in the most common usage patterns and touches upon some possible alternatives to avoid each of these pitfalls. As Rails developers most of us would have inevitably have run into callbacks. This is something easy to get started with but is even easier to lead you into unexpected behaviour in production. Also, due to their unobtrusive nature they can become forgotten landmines. Structured in the popular and fun “WAT” style, the focus is mostly on beginner to intermediate levels, others might find one or two anecdotes surprising. Help us caption & translate this video! http://amara.org/v/GF2m/
Date
Summarized using AI?
If this talk's summary was generated by AI, please check this box. A "Summarized using AI" badge will be displayed in the summary tab to indicate that the summary was generated using AI.
Show "Summarized using AI" badge on summary page
Summary
Markdown supported
In the video "WAT!! ActiveRecord Callbacks" presented by Monika M at the Garden City Ruby 2015 conference, the speaker explores the nuances and potential pitfalls of using ActiveRecord callbacks in Ruby on Rails applications. She discusses the simplicity of getting started with callbacks, but stresses their tendency to lead developers into unexpected behaviors in a production environment. Monika emphasizes that callbacks can be very unobtrusive and may be easily forgotten, creating potential landmines in code. Key points discussed include: - **Understanding Callbacks**: The talk begins with an audience engagement approach, testing familiarity with Rails and ActiveRecord callbacks. Monika shares her personal journey of learning about callbacks amidst various projects. - **Common Pitfalls**: An example is shared from early in her career where a simple callback intended to activate user accounts led to unexpected failures due to misunderstanding how Ruby methods return values, highlighting the need for awareness around callback behavior. - **Performance Impact**: A story about a project experiencing a ten-minute spike in test execution time reveals that callbacks can accumulate delayed jobs when creating user objects, leading to performance bottlenecks. - **Callback Exception Handling**: Monika explains that earlier versions of Rails suppressed exceptions in after_commit callbacks, which could lead to unnoticed errors. Fortunately, Rails 4.2 made improvements by allowing exceptions to be thrown again, enhancing reliability. - **Best Practices**: She concludes with practical advice on using callbacks judiciously, stressing their appropriate use should align with an object’s internal state rather than relying on external parameters. This insight differentiates effective callback usage from poor implementations. The speaker's anecdotes, rooted in her own experiences, serve to illustrate the broader challenges developers face when working with callbacks, and she encourages a disciplined approach to understanding and implementing them effectively in code. Monika’s talk aims to equip Rails developers, particularly at a beginner to intermediate level, with the knowledge to navigate the complexities of ActiveRecord callbacks and avoid common traps in software development.
Suggest modifications
Cancel