Posted over 8 years ago. Visible to the public.

Inspecting model callback chains

If you need to look at the list of methods that are called upon certain events (like before/after saving etc), do this:

Copy {|cb| cb.kind == :before}.map{ |c| c.instance_variable_get :@filter }

Rails 2


To look at the method names only, you could do something like that:

Growing Rails Applications in Practice
Check out our new e-book:
Learn to structure large Ruby on Rails codebases with the tools you already know and love.

Owner of this card:

Arne Hartherz
Last edit:
4 months ago
by Dominik Schöler
activerecord, callbacks
About this deck:
We are makandra and do test-driven, agile Ruby on Rails software development.
License for source code
Posted by Arne Hartherz to makandra dev
This website uses cookies to improve usability and analyze traffic.
Accept or learn more