module ActiveRecord::AutosaveAssociation
  def save_has_one_association_with_through(reflection)
    unless reflection.options[:through]
      save_has_one_association_without_through(reflection)
    else
      Rails.logger.debug "Hit Rails bug - won't save has_one throught association"
    end
  end

  alias_method_chain :save_has_one_association, :through
end
