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:


Once an application no longer requires constant development, it needs periodic maintenance for stable and secure operation. makandra offers monthly maintenance contracts that let you focus on your business while we make sure the lights stay on.

Owner of this card:

Arne Hartherz
Last edit:
6 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