Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

Pietro's latest activity

Sunday, September 19 2010
5650 callbacks execution order reversed in after_* was updated in Ruby on Rails
  • Pietro
    Pietro commented at 7:59 PM

    I think the code came from

    commit 21e7b8462113fc7c0fd1882dcc2bf7225de67b1a
    Author: Joshua Peek
    Date: Mon Oct 12 22:15:43 2009 -0500

    Callbacks, DeprecatedCallbac...

  • Pietro
    Pietro commented at 7:36 PM

    @Neeraj

    Here is the patch.

    I'll try to find in git history when the reverse_each
    first appeared.

  • Pietro
    Pietro commented at 6:49 PM

    In activesupport-3.0.0/lib/active_support/callbacks.rb
    there is only one "reverse" (method "compile" in class "CallbackChain")

    changing

    reverse_each do |callba...

Saturday, September 18 2010
5650 callbacks execution order reversed in after_* was created in Ruby on Rails
  • Pietro
    Pietro created the ticket at 12:30 AM

    In rails 3.0.0 the callbacks "after_*" executes
    the methods in reverse order.

    If in a model you have

    before_save :aa, :bb
    after_save :aa, :bb

    def aa; puts "a"; ...