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.

Luca Guidi's latest activity

Wednesday, March 11 2009
2058 Rake tasks for run engine migrations was updated in Ruby on Rails
  • Luca Guidi
    Luca Guidi commented at 11:16 AM

    Ok, in the meanwhile I played a bit with my patch, it seems to work fine for me. The only change I would apply is related to migrations execution order: as I sa...

Tuesday, March 10 2009
2146 Nested attributes doesn't run removing association callbacks was updated in Ruby on Rails
  • Luca Guidi
    Luca Guidi commented at 1:54 PM

    Ok, refactored and added tests for habtm.

  • Luca Guidi
    Luca Guidi commented at 11:22 AM

    Ok, I changed a little bit the method:

    
    # Destroy +records+ and remove from this association calling +before_remove+
    # and +after_remove+ callbacks.
    #
    # No...
  • Luca Guidi
    Luca Guidi commented at 11:14 AM

    Ok, I solved the NoMethodError problem (solution 2): AssociationCollection#callback should be protected instead of to be private.

    
    association.send(:callback,...
Monday, March 09 2009
2146 Nested attributes doesn't run removing association callbacks was updated in Ruby on Rails
Friday, March 06 2009
2146 Nested attributes doesn't run removing association callbacks was updated in Ruby on Rails
  • Luca Guidi
    Luca Guidi commented at 10:35 AM

    Invoking destroy will run ActiveRecord::Base callbacks, cause record is an instance of that class and doesn't know to belonging to an association.

    AssociationCo...

  • Luca Guidi
    Luca Guidi commented at 10:20 AM

    ..And I don't know why if use collection.send(:callback, :before_remove, record) it returns a NoMethodError.

  • Luca Guidi
    Luca Guidi commented at 10:15 AM

    Callbacks aren't ran, cause we use only record.destroy. Code similar to this is in AssociationProxy#delete, but it run also unwanted callbacks.

    Just to try, ins...

  • Luca Guidi
    Luca Guidi created the ticket at 1:30 AM
    
    class Person < ActiveRecord::Base
      has_many :emails, :after_remove => :set_preferred_email
    
      accepts_nested_attributes_for :emails, :allow_destroy => true...
Monday, March 02 2009
2058 Rake tasks for run engine migrations was updated in Ruby on Rails
  • Luca Guidi
    Luca Guidi commented at 10:19 AM

    I'll try to provide a trivial example.

    
    vendor/plugins/authentication/db/migrate/20090101000000_create_users.rb
    db/migrate/20090101000001_add_users_openid.rb...