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.

Martin Andert's latest activity

Monday, March 16 2009
2251 AssociationCollection#destroy should only delete join table records was updated in Ruby on Rails
  • Martin Andert
    • Tag changed from activerecord, associations, destroy, has_many_through, patch, tested to activerecord, associations, destroy, has_many_through
    by Martin Andert at 11:46 AM

    Eloy, wouldn't it be better to do

    
    def destroy(*records)
      delete_records(flatten_deeper(records))
      super
    end
    

    instead of

    
    def destroy(*records)
      del...
  • Martin Andert
    Martin Andert commented at 11:07 AM

    The latter was designed for always destroy the association endpoint.

    Okay. I should have read the documenting comments more conscientious.

2146 AutosaveAssociation doesn't run removing association callbacks was updated in Ruby on Rails
  • Martin Andert
    Martin Andert commented at 9:10 AM

    Failing test attached.

  • Martin Andert
    Martin Andert commented at 8:04 AM

    I found some unexpected behavior dealing with has_many :through associations. Given the following:

    
    class Post < ActiveRecord::Base
      has_many :taggings
      h...
Sunday, March 15 2009
1843 Calling delete on a has_many :through association does not call destroy on th... was updated in Ruby on Rails
  • Martin Andert
    Martin Andert commented at 7:52 PM

    Commit 47bdf3bf40ec17e1f8ca1c0e3d7f697d0c4cd1bf added a destroy method to AssociationCollection. Now I can call

    
    group.assigned_contents.destroy content
    

    ins...

Monday, February 02 2009
1843 Calling delete on a has_many :through association does not call destroy on th... was updated in Ruby on Rails
  • Martin Andert
    Martin Andert commented at 11:15 AM

    Forgot the Annotation model above:

    
    class Annotation < ActiveRecord::Base
      belongs_to :group_content_assignment
    end
    

    To make things clearer...

    
    group.as...
  • Martin Andert
    Martin Andert created the ticket at 11:03 AM

    Here is an example:

    
    class GroupContentAssignment < ActiveRecord::Base
      belongs_to :group
      belongs_to :content, :counter_cache => true
      
      has_many :an...