Skip to content

Instantly share code, notes, and snippets.

@thenoseman
Last active December 21, 2015 10:19
Show Gist options
  • Save thenoseman/6291122 to your computer and use it in GitHub Desktop.
Save thenoseman/6291122 to your computer and use it in GitHub Desktop.
Debugging before_filters in rails
> bundle open activesupport
open lib/active_support/callbacks.rb
Below ~ line 188 (result = result = #{@filter}) ->
Rails.logger.info "[callbacks] executing BEFORE :#{@filter} from inside #{@klass}" if defined?(Rails)
Below ~ line 239 ->
Rails.logger.info "[callbacks] executing AFTER :#{@filter} from inside #{@klass}"
so that it looks like this:
if #{@compiled_options}
#{@filter}
Rails.logger.info "[callbacks] executing AFTER :#{@filter} from inside #{@klass}" if defined?(Rails)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment