Fix for breaking aliasing due to sum method

Error message

    ../ active_record/associations/alias_tracker.rb:30:in   `aliased_name_for': undefined method `zero?' for nil:NilClass (NoMethodError)